/* Andalus — sign-in page */
:root {
    --brand: #7A1230;
    --brand-hover: #5A0C23;
    --ground: #F6F1EA;
    --surface: #FFFFFF;
    --ink: #231C1E;
    --ink-2: #3B3134;
    --muted: #5E5356;
    --border: #D6CBC0;
    --chip: #EDE5DA;
    --on-brand-heading: #FBF6EF;
    --on-brand-body: #E6CFD5;
    --error: #B42318;
    --radius: 10px;
    --radius-card: 12px;
    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

[hidden] {
    display: none !important;
}

body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.auth {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    background: var(--ground);
}

/* ---------- Brand panel ---------- */
.auth-brand {
    position: relative;
    flex: 1 1 480px;
    min-width: 0;
    min-height: 560px;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    background: var(--brand);
    color: var(--on-brand-body);
    overflow: hidden;
}

.auth-brand__pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.auth-brand > :not(.auth-brand__pattern) {
    position: relative;
}

.auth-eyebrow {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #F1DCE2;
}

.auth-brand__body {
    max-width: 520px;
}

.auth-brand__title {
    margin: 0 0 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 54px;
    line-height: 1.04;
    color: var(--on-brand-heading);
}

.auth-brand__lead {
    margin: 0 0 32px;
    font-size: 16px;
    line-height: 1.65;
    color: #EBD7DC;
}

.auth-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-feature {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-card);
    background: rgba(247, 241, 232, .07);
    border: 1px solid rgba(247, 241, 232, .16);
}

.auth-feature svg {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--on-brand-heading);
}

.auth-feature__title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--on-brand-heading);
}

.auth-feature__text {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--on-brand-body);
}

.auth-brand__footer {
    margin: 0;
    font-size: 13px;
    color: var(--on-brand-body);
}

/* ---------- Sign-in panel ---------- */
.auth-main {
    flex: 999 1 560px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.auth-logo {
    display: block;
    width: 92px;
    height: auto;
}

.auth-head {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 40px;
    line-height: 1.1;
    color: var(--ink);
}

.auth-subtitle {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--muted);
}

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

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
}

.auth-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-block: -12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    border-radius: 4px;
}

.auth-link:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
}

[dir="rtl"] .auth-input[type="email"] {
    direction: ltr;
    text-align: right;
}

.auth-input::placeholder {
    color: #7A6F71;
}

.auth-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(122, 18, 48, .14);
}

.auth-input[aria-invalid="true"] {
    border-color: var(--error);
}

.auth-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .14);
}

.auth-password {
    position: relative;
}

.auth-password .auth-input {
    padding-inline-end: 52px;
}

.auth-password__toggle {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.auth-password__toggle:hover {
    color: var(--ink);
}

.auth-password__toggle svg {
    width: 20px;
    height: 20px;
}

.auth-error {
    margin: 0;
    font-size: 13px;
    color: var(--error);
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    align-self: flex-start;
    font-size: 15px;
    color: var(--ink-2);
    cursor: pointer;
}

.auth-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: #FFFFFF;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s;
}

.auth-submit:hover {
    background: var(--brand-hover);
}

.auth-submit svg {
    width: 18px;
    height: 18px;
}

[dir="rtl"] .auth-submit svg {
    transform: scaleX(-1);
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-lang {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
}

.auth-lang:hover {
    color: var(--ink);
}

.auth-lang[aria-current="true"] {
    background: var(--chip);
    color: var(--ink);
    font-weight: 600;
}

.auth a:focus-visible,
.auth button:focus-visible,
.auth-check input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1023.98px) {
    .auth-brand,
    .auth-main {
        flex-basis: 100%;
    }

    .auth-brand {
        min-height: 0;
        padding: 48px 40px;
    }

    .auth-main {
        padding-block: 56px;
    }
}

@media (max-width: 639.98px) {
    .auth-brand {
        padding: 40px 24px 64px;
        gap: 0;
    }

    .auth-brand__title {
        margin: 16px 0 0;
        font-size: 32px;
    }

    .auth-brand__lead,
    .auth-features,
    .auth-brand__footer {
        display: none;
    }

    .auth-main {
        position: relative;
        margin-top: -32px;
        padding: 32px 24px 40px;
        align-items: flex-start;
        background: var(--surface);
        border-radius: 24px 24px 0 0;
    }

    .auth-card {
        gap: 28px;
    }

    .auth-head {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .auth-logo {
        width: 72px;
    }

    .auth-title {
        font-size: 34px;
    }

    .auth-input {
        font-size: 16px;
    }
}

/* ---------- Forgot / choose password ---------- */
.auth-notice {
    margin: 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: #E7F4EC;
    color: #1E5B36;
    font-size: 14px;
}

.auth-back {
    align-self: center;
    margin-block: -4px 0;
}

.auth-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--muted);
}

.auth-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-rules li::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
}

.auth-rules li.is-met {
    color: #1E5B36;
}

.auth-rules li.is-met::before {
    border-color: #2F7D4A;
    background: #2F7D4A;
}

@media (max-width: 639.98px) {
    .auth-rules {
        grid-template-columns: 1fr;
    }
}
