:root {
    --sa-bg: #f4ede0;
    --sa-bg-soft: #efe4d2;
    --sa-paper: #fffdf8;
    --sa-paper-strong: #fffaf1;
    --sa-panel: rgba(255, 250, 241, 0.92);
    --sa-panel-muted: rgba(250, 244, 232, 0.92);
    --sa-border: rgba(81, 67, 49, 0.12);
    --sa-border-strong: rgba(81, 67, 49, 0.2);
    --sa-ink: #22302b;
    --sa-ink-soft: #5d685f;
    --sa-brand: #27453d;
    --sa-brand-strong: #1d322c;
    --sa-primary: #c86b48;
    --sa-primary-strong: #b45735;
    --sa-secondary: #907153;
    --sa-accent: #d4a04a;
    --sa-success: #467457;
    --sa-success-strong: #375e46;
    --sa-warning: #c98335;
    --sa-danger: #ba5a4c;
    --sa-info: #4c7f8c;
    --sa-shadow: 0 28px 60px rgba(88, 63, 37, 0.12);
    --sa-shadow-soft: 0 16px 32px rgba(88, 63, 37, 0.08);
    --sa-radius-xl: 28px;
    --sa-radius-lg: 22px;
    --sa-radius-md: 16px;
    --sa-radius-sm: 12px;
}

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

body.sa-auth-theme {
    position: relative;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--sa-ink);
    background:
        radial-gradient(520px 340px at 0% 0%, rgba(200, 107, 72, 0.18), transparent 72%),
        radial-gradient(520px 360px at 100% 12%, rgba(39, 69, 61, 0.14), transparent 70%),
        linear-gradient(180deg, var(--sa-bg-soft) 0%, var(--sa-bg) 50%, #faf5eb 100%);
}

body.sa-auth-theme::before,
body.sa-auth-theme::after {
    content: "";
    position: fixed;
    pointer-events: none;
    border-radius: 999px;
    z-index: 0;
}

body.sa-auth-theme::before {
    top: -150px;
    right: -120px;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(212, 160, 74, 0.2), transparent 70%);
}

body.sa-auth-theme::after {
    bottom: -160px;
    left: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(76, 127, 140, 0.14), transparent 72%);
}

body.sa-auth-theme a {
    color: inherit;
}

body.sa-auth-theme .sa-auth-page {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 20px;
}

body.sa-auth-theme .sa-auth-frame {
    display: grid;
    grid-template-columns: minmax(320px, 0.94fr) minmax(0, 1.06fr);
    width: min(1180px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--sa-radius-xl);
    overflow: hidden;
    background: rgba(255, 252, 246, 0.82);
    backdrop-filter: blur(16px);
    box-shadow: var(--sa-shadow);
}

body.sa-auth-theme .sa-auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2.25rem;
    color: #f6efe3;
    background:
        radial-gradient(460px 260px at 10% 0%, rgba(212, 160, 74, 0.18), transparent 72%),
        radial-gradient(420px 240px at 100% 20%, rgba(200, 107, 72, 0.14), transparent 72%),
        linear-gradient(180deg, #2b473f 0%, #17362f 100%);
}

body.sa-auth-theme .sa-auth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 92%);
}

body.sa-auth-theme .sa-auth-hero > * {
    position: relative;
    z-index: 1;
}

body.sa-auth-theme .sa-auth-brand {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

body.sa-auth-theme .sa-auth-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1.35rem;
    background: linear-gradient(135deg, #d4a04a, #d87d52);
    color: #fff6ea;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

body.sa-auth-theme .sa-auth-brand-copy {
    min-width: 0;
}

body.sa-auth-theme .sa-auth-kicker {
    margin: 0 0 0.35rem;
    color: rgba(246, 239, 227, 0.78);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

body.sa-auth-theme .sa-auth-hero-title {
    margin: 0;
    color: #fff8ef;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

body.sa-auth-theme .sa-auth-hero-copy {
    margin: 0.65rem 0 0;
    max-width: 34rem;
    color: rgba(246, 239, 227, 0.78);
    font-size: 0.95rem;
    line-height: 1.75;
}

body.sa-auth-theme .sa-auth-hero-block {
    padding: 1.3rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--sa-radius-lg);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.sa-auth-theme .sa-auth-hero-label {
    margin: 0 0 0.5rem;
    color: rgba(246, 239, 227, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

body.sa-auth-theme .sa-auth-hero-heading {
    margin: 0;
    color: #fff8ef;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.18;
}

body.sa-auth-theme .sa-auth-hero-text {
    margin: 0.7rem 0 0;
    color: rgba(246, 239, 227, 0.76);
    font-size: 0.93rem;
    line-height: 1.75;
}

body.sa-auth-theme .sa-auth-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

body.sa-auth-theme .sa-auth-stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--sa-radius-md);
    background: rgba(255, 255, 255, 0.06);
}

body.sa-auth-theme .sa-auth-stat-label {
    color: rgba(246, 239, 227, 0.68);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.sa-auth-theme .sa-auth-stat-value {
    color: #fff8ef;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

body.sa-auth-theme .sa-auth-stat-note {
    color: rgba(246, 239, 227, 0.68);
    font-size: 0.82rem;
    line-height: 1.55;
}

body.sa-auth-theme .sa-auth-hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.4rem;
    color: rgba(246, 239, 227, 0.7);
    font-size: 0.82rem;
    font-weight: 600;
}

body.sa-auth-theme .sa-auth-hero-footer span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

body.sa-auth-theme .sa-auth-hero-footer span::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: rgba(212, 160, 74, 0.9);
}

body.sa-auth-theme .sa-auth-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2.25rem;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(247, 241, 231, 0.92) 100%);
}

body.sa-auth-theme .sa-auth-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

body.sa-auth-theme .sa-auth-panel-kicker {
    margin: 0 0 0.45rem;
    color: var(--sa-primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

body.sa-auth-theme .sa-auth-panel-title {
    margin: 0;
    color: var(--sa-brand-strong);
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.7rem, 2vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

body.sa-auth-theme .sa-auth-panel-subtitle {
    margin: 0.6rem 0 0;
    color: var(--sa-ink-soft);
    font-size: 0.95rem;
    line-height: 1.7;
}

body.sa-auth-theme .sa-auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.78rem 1rem;
    border: 1px solid var(--sa-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--sa-ink);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

body.sa-auth-theme .sa-auth-chip i {
    color: var(--sa-primary);
}

body.sa-auth-theme .sa-auth-panel-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.sa-auth-theme .sa-auth-note-card {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(39, 69, 61, 0.08);
    border-radius: var(--sa-radius-md);
    background: rgba(255, 255, 255, 0.56);
}

body.sa-auth-theme .sa-auth-note-title {
    margin: 0;
    color: var(--sa-brand-strong);
    font-size: 0.98rem;
    font-weight: 800;
}

body.sa-auth-theme .sa-auth-note-text {
    margin: 0.45rem 0 0;
    color: var(--sa-ink-soft);
    font-size: 0.9rem;
    line-height: 1.7;
}

body.sa-auth-theme .sa-auth-form {
    display: grid;
    gap: 1rem;
}

body.sa-auth-theme .sa-auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

body.sa-auth-theme .sa-auth-field {
    display: grid;
    gap: 0.45rem;
}

body.sa-auth-theme .sa-auth-label {
    color: var(--sa-ink);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

body.sa-auth-theme .sa-auth-input-group {
    display: flex;
    align-items: center;
    min-height: 3.35rem;
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-md);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

body.sa-auth-theme .sa-auth-input-group:focus-within {
    border-color: rgba(200, 107, 72, 0.38);
    box-shadow: 0 0 0 4px rgba(200, 107, 72, 0.12);
}

body.sa-auth-theme .sa-auth-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    color: var(--sa-primary);
    font-size: 0.95rem;
}

body.sa-auth-theme .sa-auth-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--sa-ink);
    padding: 0.95rem 1rem 0.95rem 0;
    font-size: 0.96rem;
    line-height: 1.4;
}

body.sa-auth-theme .sa-auth-input:focus {
    outline: 0;
    box-shadow: none;
}

body.sa-auth-theme .sa-auth-input::placeholder {
    color: rgba(93, 104, 95, 0.7);
}

body.sa-auth-theme .sa-auth-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

body.sa-auth-theme .sa-auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    color: var(--sa-ink-soft);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

body.sa-auth-theme .sa-auth-checkbox input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--sa-primary);
}

body.sa-auth-theme .sa-auth-text-link {
    color: var(--sa-brand);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

body.sa-auth-theme .sa-auth-text-link:hover,
body.sa-auth-theme .sa-auth-text-link:focus {
    color: var(--sa-primary-strong);
    text-decoration: none;
}

body.sa-auth-theme .sa-auth-submit,
body.sa-auth-theme .sa-auth-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3.25rem;
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1.2rem;
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
}

body.sa-auth-theme .sa-auth-submit {
    width: 100%;
    color: #fff8ef;
    background: linear-gradient(135deg, var(--sa-primary), var(--sa-primary-strong));
    box-shadow: 0 16px 28px rgba(180, 87, 53, 0.18);
}

body.sa-auth-theme .sa-auth-submit:hover,
body.sa-auth-theme .sa-auth-submit:focus {
    color: #fff8ef;
    filter: brightness(1.03);
    text-decoration: none;
}

body.sa-auth-theme .sa-auth-submit:focus,
body.sa-auth-theme .sa-auth-secondary:focus,
body.sa-auth-theme .sa-auth-text-link:focus {
    outline: 0;
}

body.sa-auth-theme .sa-auth-submit[disabled] {
    opacity: 0.75;
    cursor: wait;
}

body.sa-auth-theme .sa-auth-secondary {
    color: var(--sa-brand-strong);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--sa-border);
    box-shadow: var(--sa-shadow-soft);
}

body.sa-auth-theme .sa-auth-secondary:hover,
body.sa-auth-theme .sa-auth-secondary:focus {
    color: var(--sa-primary-strong);
    text-decoration: none;
}

body.sa-auth-theme .sa-auth-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

body.sa-auth-theme .sa-auth-footer {
    margin-top: auto;
    padding-top: 0.15rem;
}

body.sa-auth-theme .sa-auth-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--sa-ink-soft);
    font-size: 0.88rem;
}

body.sa-auth-theme .sa-auth-muted {
    color: var(--sa-ink-soft);
}

body.sa-auth-theme .sa-auth-inline-note {
    color: var(--sa-ink-soft);
    font-size: 0.88rem;
    line-height: 1.65;
}

body.sa-auth-theme .invalid-feedback {
    display: block;
    color: var(--sa-danger);
    font-size: 0.84rem;
    font-weight: 600;
}

body.sa-auth-theme .alert {
    margin: 0;
    border: 1px solid transparent;
    border-radius: var(--sa-radius-md);
    padding: 1rem 1.1rem;
    font-size: 0.9rem;
    line-height: 1.65;
}

body.sa-auth-theme .alert-success {
    color: var(--sa-success-strong);
    border-color: rgba(70, 116, 87, 0.18);
    background: rgba(70, 116, 87, 0.08);
}

body.sa-auth-theme .alert-info {
    color: #31545e;
    border-color: rgba(76, 127, 140, 0.16);
    background: rgba(76, 127, 140, 0.08);
}

body.sa-auth-theme .alert-danger {
    color: #8c4338;
    border-color: rgba(186, 90, 76, 0.16);
    background: rgba(186, 90, 76, 0.08);
}

body.sa-auth-theme .alert-warning {
    color: #8b5a22;
    border-color: rgba(201, 131, 53, 0.18);
    background: rgba(201, 131, 53, 0.1);
}

@media (max-width: 991px) {
    body.sa-auth-theme .sa-auth-page {
        padding: 20px 14px;
    }

    body.sa-auth-theme .sa-auth-frame {
        grid-template-columns: 1fr;
    }

    body.sa-auth-theme .sa-auth-panel {
        order: -1;
    }

    body.sa-auth-theme .sa-auth-hero,
    body.sa-auth-theme .sa-auth-panel {
        padding: 1.5rem;
    }

    body.sa-auth-theme .sa-auth-stats {
        grid-template-columns: 1fr;
    }

    body.sa-auth-theme .sa-auth-grid {
        grid-template-columns: 1fr;
    }

    body.sa-auth-theme .sa-auth-panel-head {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body.sa-auth-theme .sa-auth-brand {
        flex-direction: column;
    }

    body.sa-auth-theme .sa-auth-hero-footer,
    body.sa-auth-theme .sa-auth-link-row,
    body.sa-auth-theme .sa-auth-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    body.sa-auth-theme .sa-auth-chip {
        white-space: normal;
    }
}
