:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #101b43;
    background: #eef4f8;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: #f2f6fa;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

.background-circle {
    position: fixed;
    z-index: 0;
    bottom: -80px;
    left: -110px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: #b9d2fb;
    opacity: .9;
    pointer-events: none;
}

.app-version {
    position: fixed;
    z-index: 2;
    bottom: 12px;
    left: 16px;
    color: rgba(51, 64, 100, .65);
    font-size: .75rem;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.page-shell {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(920px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 76px 0 72px;
    flex-direction: column;
    align-items: center;
}

.page-shell--login {
    width: min(680px, calc(100% - 40px));
}

.user-controls {
    display: flex;
    width: 100%;
    min-height: 60px;
    padding: 0 26px;
    border-bottom: 1px solid rgba(21, 43, 86, .12);
    align-items: center;
    justify-content: space-between;
    color: #65708c;
    font-size: .9rem;
    text-align: left;
}

.user-controls__identity {
    margin: 0;
}

.user-controls__identity strong {
    color: #334064;
}

.user-controls__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.user-controls__divider {
    width: 1px;
    height: 18px;
    background: #aab3c5;
}

.logout-form {
    display: flex;
    margin: 0;
}

.user-action {
    display: inline-flex;
    min-height: 40px;
    padding: 0;
    border: 0;
    align-items: center;
    gap: 6px;
    color: #52607e;
    background: transparent;
    cursor: pointer;
}

.user-action svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.user-action:hover {
    color: #1762e5;
    text-decoration: underline;
}

.user-action:focus-visible {
    border-radius: 6px;
    outline: 3px solid rgba(40, 104, 235, .24);
    outline-offset: 3px;
}

.brand {
    margin-bottom: 30px;
    text-align: center;
}

.brand__primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.brand__logo {
    width: 78px;
    height: 78px;
    border-radius: 20px;
}

.brand__name {
    margin: 0;
    color: #0b1741;
    font-size: clamp(2.6rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: -.045em;
}

.brand__subtitle {
    margin: 14px 0 0;
    color: #334064;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    font-style: italic;
    line-height: 1.2;
}

.upload-card,
.result-card,
.login-card {
    width: 100%;
    border: 1px solid rgba(21, 43, 86, .1);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(45, 65, 96, .12);
}

.login-card {
    width: 100%;
    padding: 38px 52px 36px;
}

.login-card h2 {
    margin: 0;
    color: #0b1741;
    font-size: 2rem;
    line-height: 1.2;
    text-align: center;
}

.login-card__intro {
    margin: 10px 0 26px;
    color: #65708c;
    font-size: 1.1rem;
    text-align: center;
}

.login-message {
    margin: 0 0 20px;
    padding: 11px 14px;
    border-radius: 8px;
    color: #23613a;
    background: #edf8f0;
    text-align: center;
}

.login-message--error {
    color: #8f1d17;
    background: #fff0ef;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.login-form label {
    margin-bottom: 8px;
    color: #0b1741;
    font-weight: 650;
}

.login-form input {
    width: 100%;
    height: 58px;
    margin-bottom: 22px;
    padding: 0 16px;
    border: 1px solid #bfc8db;
    border-radius: 8px;
    color: #0b1741;
    background: #fff;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-form__password {
    margin-bottom: 22px;
}

.login-form .login-form__password input {
    margin-bottom: 0;
}

.login-form input:focus {
    border-color: #2868eb;
    box-shadow: 0 0 0 3px rgba(40, 104, 235, .16);
}

.login-form__submit {
    width: 100%;
    margin-top: 2px;
}

.upload-card {
    padding: 0;
    overflow: hidden;
    text-align: center;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.upload-card__body {
    padding: 38px 52px 30px;
}

.upload-card--dragging {
    border-color: #2868eb;
    box-shadow: 0 12px 34px rgba(40, 104, 235, .18);
    transform: translateY(-2px);
}

.upload-card__icon {
    width: 92px;
    height: 78px;
    margin-bottom: 18px;
    fill: none;
    stroke: #2868eb;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5;
}

.upload-card h2 {
    margin: 0;
    color: #0b1741;
    font-size: 1.85rem;
    line-height: 1.25;
}

.upload-card__hint {
    margin: 10px 0 22px;
    color: #65708c;
    font-size: 1.2rem;
}

.primary-button,
.secondary-button {
    min-height: 54px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.primary-button {
    width: min(260px, 100%);
    border: 1px solid #2868eb;
    color: #fff;
    background: #2868eb;
    font-size: 1.2rem;
}

.primary-button:hover:not(:disabled) {
    background: #1856d8;
}

.primary-button:active:not(:disabled),
.secondary-button:active {
    transform: translateY(1px);
}

.primary-button:disabled {
    cursor: wait;
    opacity: .72;
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
    outline: 3px solid rgba(40, 104, 235, .28);
    outline-offset: 3px;
}

.upload-status {
    min-height: 22px;
    margin: 16px 0 -8px;
    color: #65708c;
    font-size: .95rem;
}

.upload-status--error {
    color: #b42318;
}

.result-card {
    display: grid;
    margin-top: 24px;
    padding: 18px 20px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
}

.result-card__summary {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.result-card__check {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #35a85a;
}

.result-card__check svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.result-card__file {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.result-card__file strong,
.result-card__url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-card__file strong {
    color: #0b1741;
}

.result-card__file span {
    color: #29904b;
    font-size: .9rem;
}

.result-card__url {
    color: #1762e5;
    text-decoration: none;
}

.result-card__url:hover {
    text-decoration: underline;
}

.secondary-button {
    padding: 0 20px;
    border: 1px solid #2868eb;
    color: #1762e5;
    background: #fff;
}

.secondary-button:hover {
    background: #f0f5ff;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 52px;
}

.password-visibility {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    place-items: center;
    color: #65708c;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-visibility:hover {
    color: #1762e5;
}

.password-visibility:focus-visible {
    border-radius: 6px;
    outline: 3px solid rgba(40, 104, 235, .24);
}

.password-visibility svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-visibility__slash {
    display: none;
}

.password-visibility[aria-pressed="true"] .password-visibility__slash {
    display: block;
}

.password-dialog {
    width: min(500px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow-y: auto;
    border: 1px solid #2868eb;
    border-radius: 20px;
    color: #101b43;
    background: #fff;
    box-shadow: 0 22px 70px rgba(20, 39, 76, .3);
}

.password-dialog::backdrop {
    background: rgba(11, 23, 65, .58);
    backdrop-filter: blur(3px);
}

.password-form {
    padding: 34px 40px 38px;
}

.password-dialog__header {
    position: relative;
    margin-bottom: 28px;
}

.password-dialog__header h2 {
    margin: 0;
    color: #0b1741;
    font-size: 2rem;
    line-height: 1.2;
    text-align: center;
}

.dialog-close {
    position: absolute;
    top: -6px;
    right: -8px;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    place-items: center;
    color: #65708c;
    background: transparent;
    cursor: pointer;
}

.dialog-close:hover {
    color: #1762e5;
}

.dialog-close svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2.2;
}

.password-dialog__input {
    margin-bottom: 22px;
}

.password-dialog__input input {
    width: 100%;
    height: 60px;
    padding-left: 18px;
    border: 1px solid #bfc8db;
    border-radius: 10px;
    color: #0b1741;
    background: #fff;
    outline: none;
}

.password-dialog__input input:focus {
    border-color: #2868eb;
    box-shadow: 0 0 0 3px rgba(40, 104, 235, .16);
}

.password-strength {
    height: 5px;
    margin: -10px 2px 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e1e6ef;
}

.password-strength__bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #d7a600;
    transition: width 180ms ease, background-color 180ms ease;
}

.password-strength[data-level="moderate"] .password-strength__bar {
    background: #e98a15;
}

.password-strength[data-level="strong"] .password-strength__bar,
.password-strength[data-level="very-strong"] .password-strength__bar {
    background: #29904b;
}

.password-strength__label {
    min-height: 18px;
    margin: 0 2px 24px;
    color: #65708c;
    font-size: .82rem;
}

.password-change-message {
    margin: 0 0 20px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #8f1d17;
    background: #fff0ef;
    text-align: center;
}

.password-change-message--success {
    color: #23613a;
    background: #edf8f0;
}

.password-dialog__actions {
    display: flex;
    margin-top: 8px;
    justify-content: flex-end;
    gap: 14px;
}

.password-dialog__actions .primary-button,
.password-dialog__actions .secondary-button {
    width: 140px;
    min-height: 52px;
    font-size: 1rem;
    font-weight: 650;
    text-transform: uppercase;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .background-circle {
        bottom: -65px;
        left: -105px;
        width: 220px;
        height: 220px;
    }

    .page-shell {
        width: min(100% - 28px, 460px);
        padding: 54px 0 48px;
    }

    .page-shell--login {
        padding-top: 72px;
    }

    .user-controls {
        min-height: 0;
        padding: 18px 20px 0;
        flex-direction: column;
        align-items: stretch;
    }

    .user-controls__identity {
        margin-bottom: 8px;
    }

    .user-controls__actions {
        min-height: 56px;
        margin: 0 -8px;
        gap: 8px;
    }

    .user-controls__divider {
        height: 26px;
    }

    .user-action {
        min-height: 48px;
        flex: 1;
        justify-content: center;
    }

    .logout-form {
        flex: 1;
    }

    .logout-form .user-action {
        width: 100%;
    }

    .brand {
        margin-bottom: 28px;
    }

    .brand__primary {
        gap: 12px;
    }

    .brand__logo {
        width: 58px;
        height: 58px;
        border-radius: 15px;
    }

    .brand__name {
        font-size: clamp(1.85rem, 9vw, 2.55rem);
    }

    .brand__subtitle {
        margin: 12px 0 0;
        font-size: 1.25rem;
    }

    .upload-card {
        border-radius: 18px;
    }

    .upload-card__body {
        padding: 38px 22px 26px;
    }

    .login-card {
        padding: 34px 24px 28px;
        border-radius: 18px;
    }

    .login-card h2 {
        font-size: 1.8rem;
    }

    .login-card__intro {
        margin-bottom: 24px;
        font-size: 1.05rem;
    }

    .login-form input {
        height: 58px;
    }

    .upload-card__icon {
        width: 82px;
        height: 70px;
        margin-bottom: 22px;
    }

    .upload-card h2 {
        font-size: 1.55rem;
    }

    .upload-card__hint {
        margin-bottom: 26px;
        font-size: 1.08rem;
    }

    .primary-button {
        width: 100%;
        min-height: 58px;
    }

    .result-card {
        display: flex;
        padding: 22px;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        border-radius: 18px;
    }

    .result-card__url {
        display: block;
        padding: 15px 16px;
        border: 1px solid #d5ddeb;
        border-radius: 8px;
        background: #f5f7fb;
    }

    .secondary-button {
        width: 100%;
        min-height: 56px;
    }

    .password-form {
        padding: 28px 22px 26px;
    }

    .password-dialog__header h2 {
        padding: 0 36px;
        font-size: 1.75rem;
    }

    .password-dialog__actions .primary-button,
    .password-dialog__actions .secondary-button {
        width: 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
