/* P-53 — login / register / forgot / reset screens ("Skan" variant).
   Everything is prefixed .auth-* and lives under .auth-page, so no other screen is affected.
   Palette: terracotta #9a4f27 page, cream #faf7f2 card, dark #2b2622 side panel.
   Animations are CSS only and switched off under prefers-reduced-motion. */

.auth-page {
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 0;
    padding: 0 24px 24px;
    background: #9a4f27;
    color: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
}

@media screen {
    #app > .auth-page {
        flex: 1 1 auto;
    }
}

.auth-deco {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-circle {
    position: absolute;
    border-radius: 50%;
}

.auth-circle-a {
    top: -160px;
    left: -140px;
    width: 420px;
    height: 420px;
    background: #8a4322;
}

.auth-circle-b {
    right: -200px;
    bottom: -240px;
    width: 520px;
    height: 520px;
    background: #d58a5c;
}

.auth-top {
    position: relative;
    z-index: 1;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 12px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #ffffff;
    text-decoration: none;
}

.auth-logo:hover .logo-text,
.auth-logo:focus-visible .logo-text {
    text-decoration: underline;
}

.auth-top .lang-switch-btn {
    min-width: 44px;
    min-height: 44px;
    color: #ffffff;
    font-size: 0.95rem;
}

.auth-top .lang-switch-btn:focus-visible,
.auth-logo:focus-visible,
.auth-foot .contact-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ---- card ---------------------------------------------------------------------------------- */

.auth-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 380px 1fr;
    box-sizing: border-box;
    width: 880px;
    max-width: 100%;
    min-height: 520px;
    margin: auto;
    background: #faf7f2;
    color: #2b2622;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(43, 38, 34, 0.35);
    overflow: hidden;
}

.auth-panel-register {
    grid-template-columns: 340px 1fr;
    min-height: 640px;
}

/* ---- dark side: decorative QR + message ---------------------------------------------------- */

.auth-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 36px 32px;
    background: #2b2622;
    color: #ffffff;
    text-align: center;
}

.auth-qr {
    position: relative;
    flex: none;
    width: 200px;
    height: 200px;
}

.auth-qr-tile {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 14px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
}

.auth-qr-tile svg {
    display: block;
    width: 100%;
    height: 100%;
}

.auth-qr-ring {
    position: absolute;
    inset: -8px;
    border: 3px solid #d58a5c;
    border-radius: 22px;
    animation: auth-ring 2.4s ease-out infinite;
}

.auth-qr-scan {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 6%;
    height: 3px;
    background: #b5673a;
    border-radius: 2px;
    box-shadow: 0 0 10px #b5673a;
    animation: auth-sweep 2.6s ease-in-out infinite alternate;
}

@keyframes auth-sweep {
    from { top: 6%; }
    to { top: 92%; }
}

@keyframes auth-ring {
    0% { opacity: 0.9; transform: scale(0.97); }
    100% { opacity: 0; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-qr-ring,
    .auth-qr-scan {
        animation: none;
    }

    .auth-qr-ring {
        opacity: 0.6;
        transform: none;
    }

    .auth-qr-scan {
        top: 50%;
    }
}

.auth-tagline {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.auth-tagline-sub {
    margin: 10px 0 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #e7e0d6;
}

.auth-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: auth-step;
    text-align: left;
}

.auth-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    line-height: 1.35;
    counter-increment: auth-step;
}

.auth-steps li::before {
    content: counter(auth-step);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #d58a5c;
    color: #2b2622;
    font-weight: 800;
}

/* ---- form side ----------------------------------------------------------------------------- */

.auth-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    box-sizing: border-box;
    min-width: 0;
    padding: 44px 48px;
    background: #faf7f2;
}

.auth-form h1 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.2;
    text-align: left;
}

.auth-form h2 {
    margin: 0;
    font-size: 1.15rem;
    text-align: left;
}

.auth-form p {
    margin: 0;
    line-height: 1.45;
}

.auth-form form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-sub,
.auth-hint {
    color: #6b6259;
}

.auth-hint {
    font-size: 0.85rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.auth-field label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2b2622;
}

.auth-form input {
    box-sizing: border-box;
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border: 1.5px solid #8a8077;
    border-radius: 12px;
    background: #ffffff;
    color: #2b2622;
    font: inherit;
    font-size: 1rem;
}

.auth-form input:focus-visible,
.auth-form .password-toggle:focus-visible,
.auth-link:focus-visible,
.auth-form .rz-button:focus-visible {
    outline: 2px solid #2b2622;
    outline-offset: 2px;
}

.auth-form .password-input input {
    padding-right: 5.25rem;
}

.auth-form .password-toggle {
    min-width: 44px;
    padding: 0 14px;
    border-radius: 12px;
    color: #9a4f27;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-form .rz-button.auth-submit,
.auth-form .rz-button.auth-submit:hover:not(.rz-state-disabled) {
    width: 100%;
    height: 54px;
    margin-top: 6px;
    border-radius: 12px;
    background: #9a4f27;
    box-shadow: none;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
}

.auth-form .rz-button.auth-submit:hover:not(.rz-state-disabled) {
    background: #7f3f1d;
}

.auth-form .rz-button.auth-submit.rz-state-disabled {
    opacity: 0.6;
}

.auth-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #9a4f27;
    font-weight: 600;
    text-decoration: underline;
}

.auth-form .form-error {
    font-size: 0.9rem;
}

.auth-loading {
    position: relative;
    z-index: 1;
    margin: auto;
    color: #ffffff;
}

/* ---- password meter: four bars, filled by how much of the existing length rule is met ------ */

.auth-meter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-meter li {
    height: 6px;
    border-radius: 3px;
    background: #e3dacd;
}

.auth-meter-1 li:nth-child(-n + 1),
.auth-meter-2 li:nth-child(-n + 2),
.auth-meter-3 li:nth-child(-n + 3),
.auth-meter-4 li:nth-child(-n + 4) {
    background: #9a4f27;
}

.auth-meter-4 li {
    background: #2f7a3e;
}

/* ---- footer strip (contact link) ----------------------------------------------------------- */

.auth-foot {
    flex: none;
    display: flex;
    justify-content: center;
    padding: 0 24px 8px;
    background: #9a4f27;
}

.auth-foot .contact-link {
    min-height: 44px;
    background: none;
    border: 0;
    color: #ffffff;
    font: inherit;
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
}

/* ---- narrow screens ------------------------------------------------------------------------ */

@media (max-width: 860px) {
    .auth-panel,
    .auth-panel-register {
        grid-template-columns: 280px 1fr;
    }

    .auth-side {
        padding: 28px 20px;
    }

    .auth-form {
        padding: 36px 28px;
    }
}

@media (max-width: 640px) {
    .auth-page {
        padding: 0;
    }

    .auth-top {
        padding: 12px 20px 4px;
    }

    .auth-panel,
    .auth-panel-register {
        display: flex;
        flex-direction: column;
        flex: 1 0 auto;
        width: 100%;
        min-height: 0;
        margin: 0;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .auth-side {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 8px 20px 20px;
        background: transparent;
        text-align: left;
    }

    .auth-qr {
        width: 84px;
        height: 84px;
    }

    .auth-qr-tile {
        padding: 7px;
        border-radius: 10px;
    }

    .auth-qr-ring {
        inset: -5px;
        border-width: 2px;
        border-radius: 14px;
    }

    .auth-tagline {
        font-size: 1.2rem;
    }

    .auth-tagline-sub,
    .auth-steps {
        display: none;
    }

    .auth-form {
        flex: 1 0 auto;
        justify-content: flex-start;
        padding: 28px 20px 32px;
        border-radius: 28px 28px 0 0;
    }

    .auth-foot {
        padding: 0 20px 4px;
        background: #faf7f2;
    }

    .auth-foot .contact-link {
        color: #6b6259;
    }

    .auth-foot .contact-link:focus-visible {
        outline-color: #2b2622;
    }
}
