/* The sign-in modal, shared by the homepage and the archive homepage (PUBLIC-EXPERIENCE-POLISH-1). */
/* AUTH-ACCESS-MODAL-EXPERIENCE-1: one modal, two visual states. Auth
   authority remains in the existing server endpoints below. */
/* The wordmark inside the modal does not lean on the host page's own CSS (index.html
   and landing_archive.html style it differently). */
.login-modal .canon-word { display: inline-block; white-space: nowrap; letter-spacing: 0.07em; color: #95d6e8; -webkit-text-fill-color: #95d6e8; }
.login-modal .canon-i { color: #95d6e8; -webkit-text-fill-color: #95d6e8; text-shadow: 0 0 0.4em rgba(149, 214, 232, 0.26); }
body.login-modal-open { overflow: hidden; }

.login-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 4, 5, 0.82);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 20020;
}

.login-backdrop.open { display: flex; }

.login-modal {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(110% 60% at 50% 0%, rgba(149, 214, 232, 0.055), transparent 54%),
        linear-gradient(180deg, #141617 0%, #0e1011 100%);
    border: 1px solid rgba(255, 255, 255, 0.105);
    border-radius: 24px;
    padding: clamp(34px, 5vw, 48px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 34px 110px rgba(0, 0, 0, 0.7);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.login-modal-content {
    width: min(100%, 450px);
    margin: 0 auto;
}

.login-state[hidden],
.login-method[hidden],
.login-divider[hidden] { display: none !important; }

.login-state:not([hidden]) {
    animation: loginStateIn 180ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes loginStateIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-modal-head {
    padding-right: 48px;
    margin-bottom: 26px;
}

.login-modal-title {
    margin: 0 0 10px;
    color: #f3f4f1;
    font-size: clamp(26px, 3vw, 30px);
    font-weight: 760;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.login-modal-title .canon-word { color: #a7dfe9; }

.login-modal-sub {
    max-width: 39ch;
    margin: 0;
    color: #989d9a;
    font-size: 14px;
    line-height: 1.58;
}

.login-email-identity {
    display: block;
    margin-top: 4px;
    color: #e7e9e6;
    font-weight: 720;
    overflow-wrap: anywhere;
}

.login-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 50%;
    color: #8d928f;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.login-close:hover {
    color: #edf0ed;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.055);
}

.login-close:focus-visible,
.login-field input:focus-visible,
.login-action:focus-visible,
.login-tertiary:focus-visible,
.login-footer-link:focus-visible {
    outline: 2px solid #9fd9e7;
    outline-offset: 3px;
}

.login-field { margin-bottom: 18px; }

.login-field-label {
    display: block;
    margin: 0 0 9px 2px;
    color: #a5aaa7;
    font-size: 12px;
    font-weight: 720;
    letter-spacing: 0.025em;
}

.login-field input {
    width: 100%;
    min-height: 56px;
    padding: 0 17px;
    background: rgba(6, 8, 9, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.115);
    border-radius: 13px;
    color: #f4f5f2;
    caret-color: #9fd9e7;
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-field input::placeholder { color: #666b68; opacity: 1; }

.login-field input:hover { border-color: rgba(255, 255, 255, 0.18); }

.login-field input:focus {
    background: rgba(8, 11, 12, 0.96);
    border-color: rgba(159, 217, 231, 0.72);
    box-shadow: 0 0 0 4px rgba(149, 214, 232, 0.1);
}

.login-field input[aria-invalid="true"] {
    border-color: rgba(231, 147, 147, 0.72);
    box-shadow: 0 0 0 4px rgba(211, 105, 105, 0.09);
}

.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f4f5f2;
    caret-color: #9fd9e7;
    box-shadow: 0 0 0 1000px #090c0d inset, 0 0 0 4px rgba(149, 214, 232, 0.1);
    transition: background-color 9999s ease-out 0s;
}

.login-code-input {
    min-height: 72px !important;
    padding-left: calc(18px + 0.46em) !important;
    text-align: center;
    color: #f7f8f5 !important;
    font-size: clamp(28px, 6vw, 34px) !important;
    font-weight: 740;
    letter-spacing: 0.46em;
    font-variant-numeric: tabular-nums;
}

.login-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 13px 20px;
    border-radius: 13px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 760;
    line-height: 1.25;
    cursor: pointer;
    transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.login-action:active:not(:disabled) { transform: translateY(1px); }

.login-action:disabled { cursor: default; opacity: 0.58; }

.login-primary {
    color: #061214;
    background: linear-gradient(180deg, #d8f0f4 0%, #abdce5 100%);
    border: 1px solid rgba(199, 236, 242, 0.72);
    box-shadow: 0 13px 30px rgba(56, 132, 145, 0.19), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.login-primary:hover:not(:disabled) { background: linear-gradient(180deg, #e7f7f9 0%, #b9e4eb 100%); }

.login-secondary {
    color: #d9ddda;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.login-secondary:hover:not(:disabled) {
    color: #f2f4f1;
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.18);
}

.login-secondary.is-primary {
    color: #061214;
    background: linear-gradient(180deg, #d8f0f4 0%, #abdce5 100%);
    border-color: rgba(199, 236, 242, 0.72);
}

.login-method-copy {
    margin: 10px auto 0;
    color: #858a87;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: center;
}

.login-tertiary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    background: none;
    border: 0;
    border-radius: 8px;
    color: #8f9491;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 680;
    line-height: 1.35;
    text-decoration: underline;
    text-decoration-color: rgba(159, 217, 231, 0.28);
    text-underline-offset: 4px;
    cursor: pointer;
}

.login-tertiary:hover:not(:disabled) { color: #cbd0cd; }
.login-tertiary:disabled { color: #686d6a; cursor: default; text-decoration: none; }

.login-passkey-alternate { display: flex; justify-content: center; margin-top: 2px; }

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 17px 0;
    color: #666b68;
    font-size: 10px;
    font-weight: 740;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.075);
}

.login-status {
    min-height: 21px;
    margin-top: 13px;
    color: #a5aaa7;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: center;
}

.login-status.is-error { color: #e6aaaa; }

.login-code-help {
    margin: 14px 0 0;
    color: #7f8581;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: center;
}

.login-code-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.login-footer {
    margin: 12px 0 0;
    color: #717672;
    font-size: 12px;
    text-align: center;
}

.login-footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
    color: #929793;
    text-underline-offset: 4px;
}
.login-footer-link:hover { color: #c9cecb; }

.login-sr-only {
    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: 560px) {
    .login-backdrop {
        align-items: flex-end;
        padding:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .login-modal {
        width: 100%;
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
        padding: 32px 22px 24px;
        border-radius: 22px;
    }

    .login-modal-head { margin-bottom: 22px; }
    .login-modal-title { font-size: 26px; }
    .login-code-input { letter-spacing: 0.34em; padding-left: calc(16px + 0.34em) !important; }
}

@media (max-height: 620px) {
    .login-backdrop { align-items: flex-start; padding-top: max(8px, env(safe-area-inset-top)); }
    .login-modal { padding-top: 28px; padding-bottom: 22px; }
    .login-modal-head { margin-bottom: 18px; }
    .login-field { margin-bottom: 14px; }
    .login-divider { margin: 12px 0; }
}
