/* ====================================
   Auth Theme – Register & Login
   (Stars, parchment, door, role cards)
   ==================================== */

:root,
[data-theme="light"] {
    --auth-primary: #f4c025;
    --auth-primary-hover: #e5b01f;
    --auth-bg-dark: #221e10;
    --auth-bg-light: #f8f8f5;
    --auth-parchment: linear-gradient(to bottom, #fdfbf7, #f2e6d8);
    --auth-parchment-border: #d1c4b2;
    --auth-wood-dark: #3d2b1f;
    --auth-wood-light: #5c4033;
    --auth-scroll-roll: #e6dccf;
    --auth-text-dark: #3e3422;
    --auth-text-muted: #6b5d46;
    --auth-seal-red: #8b2323;
    --auth-seal-red-hover: #a62b2b;
    --auth-parchment-input-bg: rgba(255, 255, 255, 0.55);
    --auth-parchment-surface: rgba(255, 255, 255, 0.45);
    --auth-parchment-divider-bg: rgba(253, 251, 247, 0.9);
}

[data-theme="dark"] {
    --auth-parchment: linear-gradient(180deg, rgba(38, 32, 22, 0.98) 0%, rgba(22, 19, 12, 0.99) 100%);
    --auth-parchment-border: rgba(244, 192, 37, 0.22);
    --auth-scroll-roll: #3a3226;
    --auth-text-dark: #f5f0e8;
    --auth-text-muted: #b8b0a0;
    --auth-seal-red: #e07a7a;
    --auth-seal-red-hover: #f09090;
    --auth-parchment-input-bg: rgba(12, 10, 7, 0.65);
    --auth-parchment-surface: rgba(255, 255, 255, 0.06);
    --auth-parchment-divider-bg: rgba(22, 19, 12, 0.92);
}

/* Auth shell – fixed viewport, scrollable body, pinned footer */
html:has(body.auth-layout) {
    height: 100%;
    overflow: hidden;
}

body.auth-layout {
    overflow: hidden;
    height: 100%;
    min-height: 100dvh;
}

body.auth-layout.site-background {
    min-height: 0;
}

body.auth-layout .auth-content-wrap {
    height: 100dvh;
    height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Page wrapper – when using common layer (body.site-background) background is transparent */
.auth-page {
    flex: 1;
    min-height: 0;
    height: 100%;
    max-height: 100dvh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.auth-page-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 3.75rem 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    scrollbar-gutter: stable;
}

.auth-page-body::-webkit-scrollbar {
    width: 6px;
}

.auth-page-body::-webkit-scrollbar-thumb {
    background: rgba(244, 192, 37, 0.35);
    border-radius: 3px;
}

[data-theme="light"] .auth-page-body::-webkit-scrollbar-thumb {
    background: rgba(180, 83, 9, 0.35);
}

.auth-page-footer {
    flex-shrink: 0;
    padding: 0.5rem 1rem max(0.75rem, env(safe-area-inset-bottom));
    text-align: center;
    position: relative;
    z-index: 10;
    background: linear-gradient(to top, rgba(15, 12, 8, 0.72), rgba(15, 12, 8, 0));
}

[data-theme="light"] .auth-page-footer {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
}

.auth-page-footer.auth-footer-link {
    margin-top: 0;
}

.auth-page:not(:has(.auth-page-footer)) .auth-page-body {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.auth-page-body > .auth-door-wrap {
    margin-block: auto;
    width: 100%;
}

.auth-page-body .auth-intro {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.auth-page-body .auth-intro h1 {
    font-size: clamp(1.35rem, 4vw, 2rem);
    margin-bottom: 0.35rem;
}

.auth-page-body .auth-intro p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.auth-page-body .auth-role-picker {
    margin-bottom: 1rem;
}

/* Light: readable text on sky */
[data-theme="light"] .auth-page {
    background: transparent;
    color: var(--theme-text-primary, #1a1a2e);
}

/* Dark: light text on night sky */
[data-theme="dark"] .auth-page {
    background: transparent;
    color: var(--theme-text-primary, #ecf0f1);
}

/* Fallback when not using site-background (e.g. legacy) */
body:not(.site-background) .auth-page {
    background: var(--auth-bg-dark);
    color: #fff;
}

/* Prevent login/register CSS from covering common layer when used on auth layout */
body.site-background .login-page,
body.site-background .register-page {
    background: transparent !important;
}


.auth-page .forgot-password-container {
    position: relative;
    z-index: 10;
}

/* Cabin frame (optional border) */
.auth-frame {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border: 20px solid #3e3422;
    opacity: 0.35;
}

/* Intro block (Register) */
.auth-intro {
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 36rem;
    position: relative;
    z-index: 10;
}

.auth-intro h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--auth-primary);
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.auth-intro p {
    color: rgba(209, 213, 219, 0.95);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Role picker (Register) – compact segments; keep .role-card + data-role for JS */
.auth-role-picker {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto 1.25rem;
    position: relative;
    z-index: 10;
}

.auth-role-picker-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.92);
}

.auth-role-picker-label i {
    color: var(--auth-primary);
    font-size: 0.9rem;
}

.auth-role-segments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .auth-role-segments {
        flex-direction: row;
        gap: 0.625rem;
    }
}

.auth-role-segment {
    flex: 1;
    position: relative;
    border: 2px solid rgba(244, 192, 37, 0.22);
    border-radius: 0.75rem;
    background: rgba(34, 30, 16, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-role-segment:hover {
    border-color: rgba(244, 192, 37, 0.55);
    background: rgba(34, 30, 16, 0.72);
}

.auth-role-segment input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-segment label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    margin: 0;
    cursor: pointer;
    min-height: 3rem;
}

@media (min-width: 640px) {
    .auth-role-segment label {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 0.75rem 0.5rem;
        min-height: 4.5rem;
        gap: 0.375rem;
    }
}

.auth-role-segment-icon {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    color: var(--auth-primary);
    font-size: 1.1rem;
    line-height: 1;
    background: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.auth-role-segment-icon i {
    font-size: inherit;
    margin: 0;
    color: inherit;
    line-height: 1;
}

.auth-role-segment-title {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #f5f5f4;
    line-height: 1.25;
}

@media (min-width: 640px) {
    .auth-role-segment-title {
        flex: unset;
        font-size: 0.75rem;
    }
}

.auth-role-segment-check {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--auth-primary);
    display: none;
    align-items: center;
    justify-content: center;
    color: #1c1917;
    font-size: 0.6rem;
}

@media (min-width: 640px) {
    .auth-role-segment-check {
        position: absolute;
        top: 0.4rem;
        inset-inline-end: 0.4rem;
    }
}

.auth-role-segment:has(input:checked),
.role-card.auth-role-segment:has(input[type="radio"]:checked) {
    border-color: var(--auth-primary);
    background: rgba(244, 192, 37, 0.14);
    box-shadow: 0 0 0 1px rgba(244, 192, 37, 0.35);
}

.auth-role-segment:has(input:checked) .auth-role-segment-icon {
    color: var(--auth-primary);
    transform: scale(1.08);
}

.auth-role-segment:has(input:checked) .auth-role-segment-check {
    display: inline-flex;
    border-color: var(--auth-primary);
    background: var(--auth-primary);
    color: #1c1917;
}

.auth-role-segment:has(input:checked) .auth-role-segment-check i {
    color: #1c1917;
}

.auth-role-hint {
    margin: 0.625rem 0 0;
    padding: 0 0.25rem;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgba(209, 213, 219, 0.9);
    min-height: 1.2rem;
}

.auth-role-error {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Block legacy register.css on auth role segments */
.role-card.auth-role-segment input[type="radio"]:checked + label {
    background-color: transparent !important;
    color: inherit !important;
}

.role-card.auth-role-segment label i {
    font-size: inherit;
    margin: 0;
}

.role-card.auth-role-segment:has(input[type="radio"]:checked) label i,
.role-card.auth-role-segment:has(input[type="radio"]:checked) label h5,
.role-card.auth-role-segment:has(input[type="radio"]:checked) label p {
    color: inherit !important;
}

/* Parchment form container (Register) */
.auth-parchment-wrap {
    width: 100%;
    max-width: 42rem;
    position: relative;
    z-index: 10;
    margin-top: 0.5rem;
}

.auth-scroll-roll {
    height: 2rem;
    width: 104%;
    margin-left: -2%;
    background: var(--auth-scroll-roll);
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 20;
}

.auth-scroll-roll-top {
    border-bottom: 1px solid var(--auth-parchment-border);
}

.auth-scroll-roll-bottom {
    border-top: 1px solid var(--auth-parchment-border);
    margin-top: -1px;
}

.auth-scroll-roll::before {
    content: '';
    width: 90%;
    height: 4px;
    background: var(--auth-parchment-border);
    opacity: 0.5;
    border-radius: 2px;
}

.auth-parchment {
    background: var(--auth-parchment);
    color: var(--auth-text-dark);
    padding: 2rem 1.5rem;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    position: relative;
    z-index: 10;
}

@media (min-width: 768px) {
    .auth-parchment {
        padding: 2.5rem 3rem;
    }
}

.auth-parchment-texture {
    position: absolute;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/cream-paper.png');
    opacity: 0.35;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.auth-parchment-inner {
    position: relative;
    z-index: 1;
}

.auth-parchment h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-text-dark);
    margin-bottom: 0.25rem;
}

.auth-parchment .auth-parchment-sub {
    text-align: center;
    color: var(--auth-text-muted);
    margin-bottom: 1.5rem;
}

.auth-parchment .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--auth-text-dark);
    margin-bottom: 0.4rem;
    display: block;
}

.auth-parchment .form-control {
    width: 100%;
    min-height: 3rem;
    background: var(--auth-parchment-input-bg);
    border: 1.5px solid var(--auth-parchment-border);
    color: var(--auth-text-dark);
    border-radius: 0.625rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-parchment .form-control:hover:not(:focus):not(:disabled) {
    border-color: color-mix(in srgb, var(--auth-parchment-border) 70%, var(--auth-primary) 30%);
    background: color-mix(in srgb, var(--auth-parchment-input-bg) 85%, #fff 15%);
}

.auth-parchment .form-control:focus {
    border-color: var(--auth-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(244, 192, 37, 0.22);
    background: rgba(255, 255, 255, 0.72);
}

.auth-parchment .form-control::placeholder {
    color: var(--auth-text-muted);
    opacity: 0.55;
}

.auth-parchment .btn-seal {
    width: 100%;
    background: var(--auth-seal-red);
    color: var(--auth-bg-light);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    border: 2px solid #5c1616;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.auth-parchment .btn-seal:hover:not(:disabled) {
    background: var(--auth-seal-red-hover);
    transform: scale(1.01);
}

.auth-parchment .btn-seal:disabled,
.auth-parchment .btn-seal.loading {
    cursor: wait;
    opacity: 0.9;
}

.auth-parchment .auth-terms {
    text-align: center;
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    margin-top: 1rem;
}

.auth-parchment .auth-terms a {
    color: var(--auth-text-dark);
    text-decoration: underline;
}

.auth-parchment .auth-terms a:hover {
    color: var(--auth-wood-dark);
}

.auth-parchment-icon {
    font-size: 2.5rem;
    color: var(--auth-text-muted);
}

.auth-parchment .auth-info-box {
    background: var(--auth-parchment-surface);
    border: 1px solid var(--auth-parchment-border);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    text-align: start;
}

.auth-parchment .auth-info-box h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--auth-text-dark);
    margin-bottom: 0.75rem;
}

.auth-parchment .auth-info-box h5 i {
    color: #2563eb;
    margin-inline-end: 0.5rem;
}

.auth-parchment .auth-info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-parchment .auth-info-box ul li {
    color: var(--auth-text-muted);
    margin-bottom: 0.5rem;
    padding-inline-start: 1.25rem;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-parchment .auth-info-box ul li::before {
    content: "•";
    position: absolute;
    inset-inline-start: 0;
    color: var(--auth-seal-red);
    font-weight: bold;
}

.auth-parchment .auth-info-box ul li:last-child {
    margin-bottom: 0;
}

.auth-parchment .auth-info-box a {
    color: var(--auth-seal-red);
    font-weight: 600;
    text-decoration: none;
}

.auth-parchment .auth-info-box a:hover {
    text-decoration: underline;
}

.auth-parchment .alert-success {
    background: rgba(22, 101, 52, 0.12);
    border: 1px solid rgba(22, 101, 52, 0.35);
    color: #14532d;
    border-radius: 0.5rem;
}

.auth-parchment .password-input-wrapper {
    position: relative;
    display: block;
}

.auth-parchment .input-icon-wrap {
    position: relative;
}

.auth-parchment .input-icon-wrap .input-icon {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted, #78716c);
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 1;
}

.auth-parchment .input-icon-wrap:focus-within .input-icon {
    color: var(--auth-seal-red, #8b2323);
}

.auth-parchment .password-strength {
    margin-top: 0.5rem;
}

.auth-parchment .strength-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.auth-parchment .strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.auth-parchment .strength-bar-fill.weak {
    width: 33%;
    background-color: #dc2626;
}

.auth-parchment .strength-bar-fill.medium {
    width: 66%;
    background-color: #d97706;
}

.auth-parchment .strength-bar-fill.strong {
    width: 100%;
    background-color: #16a34a;
}

.auth-parchment .strength-text {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
}

.auth-parchment .strength-text.weak { color: #dc2626; }
.auth-parchment .strength-text.medium { color: #d97706; }
.auth-parchment .strength-text.strong { color: #16a34a; }

.auth-parchment .password-requirements {
    background: var(--auth-parchment-surface);
    border: 1px solid var(--auth-parchment-border);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.auth-parchment .password-requirements .req-title {
    font-weight: 700;
    color: var(--auth-text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.auth-parchment .password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-parchment .password-requirements ul li {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    margin-bottom: 0.25rem;
}

.auth-parchment .password-requirements ul li i {
    margin-inline-end: 0.5rem;
    font-size: 0.75rem;
}

.auth-parchment .password-requirements ul li i.fa-times-circle {
    color: #9ca3af;
}

.auth-parchment .password-requirements ul li i.fa-check-circle,
.auth-parchment .password-requirements ul li.valid {
    color: #16a34a;
}

/* Login: door frame */
.auth-door-wrap {
    width: 100%;
    max-width: 28rem;
    position: relative;
    z-index: 10;
    padding: 0.25rem;
}

.auth-door-frame {
    border-radius: 9999px 9999px 0.75rem 0.75rem;
    padding: 4px;
    background: linear-gradient(to bottom, var(--auth-wood-light), var(--auth-wood-dark));
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.auth-door-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid #7a5c45;
    border-radius: inherit;
    opacity: 0.5;
    pointer-events: none;
}

.auth-door {
    background: rgba(34, 30, 16, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--auth-wood-light);
    border-radius: inherit;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .auth-door {
        padding: 3rem 2.5rem;
    }
}

.auth-door-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8rem;
    height: 8rem;
    background: rgba(244, 192, 37, 0.2);
    filter: blur(60px);
    border-radius: 50%;
    pointer-events: none;
}

.auth-door-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.auth-door-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(244, 192, 37, 0.2), transparent);
    border: 1px solid rgba(244, 192, 37, 0.4);
    box-shadow: 0 0 15px rgba(244, 192, 37, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-primary);
    font-size: 1.75rem;
}

.auth-door-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-primary);
    letter-spacing: 0.02em;
}

.auth-door-header p {
    color: #a8a29e;
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.auth-door .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e7e5e4;
    margin-bottom: 0.4rem;
    display: block;
}

.auth-door .form-control {
    width: 100%;
    min-height: 3rem;
    background: #1a160c;
    border: 1.5px solid var(--auth-wood-dark);
    color: #e7e5e4;
    border-radius: 0.625rem;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-door .form-control:hover:not(:focus):not(:disabled) {
    border-color: color-mix(in srgb, var(--auth-wood-dark) 60%, var(--auth-primary) 40%);
}

.auth-door .form-control:focus {
    border-color: var(--auth-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(244, 192, 37, 0.22), inset 0 1px 3px rgba(0, 0, 0, 0.25);
    background: #1f1a0e;
}

.auth-door .form-control::placeholder {
    color: #78716c;
    opacity: 0.7;
}

.auth-door .input-icon-wrap {
    position: relative;
}

.auth-door .input-icon-wrap .form-control {
    padding-inline-start: 3rem;
    padding-inline-end: 1rem;
}

.auth-door .password-input-wrapper.input-icon-wrap .form-control {
    padding-inline-start: 3rem;
    padding-inline-end: 3.25rem;
}

.auth-door .input-icon {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #78716c;
    font-size: 1.125rem;
    pointer-events: none;
}


.auth-door .form-check-label {
    color: #d6d3d1;
    font-size: 0.875rem;
}

.auth-door .form-group a.small,
.auth-door .form-group .small {
    color: rgba(244, 192, 37, 0.9);
    text-decoration: none;
    font-size: 0.875rem;
}

.auth-door .form-group a.small:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

[data-theme="light"] .auth-door .form-check-label {
    color: #57534e;
}

[data-theme="light"] .auth-door .form-group a.small {
    color: #b45309;
}

.auth-door .input-icon-wrap:focus-within .input-icon {
    color: var(--auth-primary);
}

.auth-door .btn-wood {
    width: 100%;
    margin-top: 1.5rem;
    background: var(--auth-wood-dark);
    background-image: repeating-linear-gradient(
        45deg,
        transparent 0,
        transparent 2px,
        rgba(0,0,0,0.2) 2px,
        rgba(0,0,0,0.2) 8px
    );
    border-top: 2px solid var(--auth-wood-light);
    border-bottom: 2px solid var(--auth-wood-light);
    color: var(--auth-primary);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

.auth-door .btn-wood:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(244, 192, 37, 0.4);
}

.auth-door .btn-wood:active:not(:disabled) {
    transform: scale(0.98);
}

.auth-door-links {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
}

.auth-door-links a {
    color: rgba(234, 221, 207, 0.85);
    text-decoration: none;
    border-bottom: 1px dashed rgba(234, 221, 207, 0.35);
    padding-bottom: 2px;
}

.auth-door-links a:hover {
    color: var(--auth-primary);
}

/* Form check (remember me, terms) */
.auth-door .form-check-input:checked {
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-parchment .form-check-input:checked {
    background-color: var(--auth-seal-red);
    border-color: var(--auth-seal-red);
}

/* Links below form */
.auth-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    position: relative;
    z-index: 10;
}

.auth-footer-link a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* Alerts in theme */
.auth-parchment .alert-danger,
.auth-door .alert-danger {
    background: rgba(185, 28, 28, 0.2);
    border: 1px solid rgba(185, 28, 28, 0.5);
    color: #fecaca;
    border-radius: 0.5rem;
}

.auth-door .alert-danger {
    background: rgba(185, 28, 28, 0.25);
}

.auth-door .alert-info {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.35);
    color: #bfdbfe;
    border-radius: 0.5rem;
}

[data-theme="light"] .auth-door .alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

[data-theme="light"] .auth-door .alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

[data-theme="light"] .auth-door .btn-wood {
    color: #b45309;
    border-top-color: #d6d3d1;
    border-bottom-color: #d6d3d1;
}

[data-theme="light"] .auth-door .btn-outline-secondary {
    border-color: #d6d3d1;
    color: #44403c;
    background: #fff;
}

[data-theme="light"] .auth-door .btn-outline-secondary:hover {
    border-color: #b45309;
    color: #b45309;
    background: #fffbeb;
}

/* Divider (Login – social) */
.auth-divider {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-divider span {
    background: rgba(34, 30, 16, 0.8);
    padding: 0 1rem;
    color: #a8a29e;
    font-size: 0.875rem;
}

/* Social buttons in door theme */
.auth-door .btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--auth-wood-light);
    color: #e7e5e4;
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.auth-door .btn-outline-secondary:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
}

/* ========== Light mode ========== */
[data-theme="light"] .auth-page {
    color: #1c1917;
}

/* When using common site-background, keep transparent so day sun shows; otherwise use parchment */
body.site-background [data-theme="light"] .auth-page {
    background: transparent !important;
}

body:not(.site-background) [data-theme="light"] .auth-page {
    background: #e8e4dc;
}

[data-theme="light"] .auth-frame {
    border-color: #a8a29e;
    opacity: 0.25;
}

[data-theme="light"] .auth-intro h1 {
    color: #b45309;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

[data-theme="light"] .auth-intro p {
    color: #57534e;
}

[data-theme="light"] .auth-role-picker-label {
    color: #44403c;
}

[data-theme="light"] .auth-role-segment {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(180, 83, 9, 0.22);
}

[data-theme="light"] .auth-role-segment:hover {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(180, 83, 9, 0.45);
}

[data-theme="light"] .auth-role-segment:has(input:checked),
[data-theme="light"] .role-card.auth-role-segment:has(input[type="radio"]:checked) {
    background: rgba(251, 191, 36, 0.14);
    border-color: #b45309;
    box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.25);
}

[data-theme="light"] .auth-role-segment-title {
    color: #1c1917;
}

[data-theme="light"] .auth-role-segment-icon {
    color: #b45309;
}

[data-theme="light"] .auth-role-segment:has(input:checked) .auth-role-segment-icon {
    color: #b45309;
}

[data-theme="light"] .auth-role-segment:has(input:checked) .auth-role-segment-check {
    border-color: #b45309;
    background: #b45309;
    color: #fff;
}

[data-theme="light"] .auth-role-segment:has(input:checked) .auth-role-segment-check i {
    color: #fff;
}

[data-theme="light"] .auth-role-hint {
    color: #57534e;
}

[data-theme="light"] .auth-door {
    background: rgba(255, 255, 255, 0.94);
    border-color: #d6d3d1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .auth-door-frame {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .auth-door {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .auth-intro p {
    color: rgba(226, 232, 240, 0.88);
}

[data-theme="dark"] .auth-footer-link .text-white-50 {
    color: rgba(255, 255, 255, 0.78) !important;
}

[data-theme="light"] .auth-door-header h1 {
    color: #b45309;
}

[data-theme="light"] .auth-door-header p {
    color: #78716c;
}

[data-theme="light"] .auth-door .form-label {
    color: #57534e;
}

[data-theme="light"] .auth-door .form-control {
    background: #fff;
    border-color: #d6d3d1;
    color: #1c1917;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .auth-door .form-control:focus {
    border-color: #b45309;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

[data-theme="light"] .auth-door .input-icon {
    color: #a8a29e;
}

[data-theme="light"] .auth-door .input-icon-wrap:focus-within .input-icon {
    color: #b45309;
}

[data-theme="light"] .auth-door-links a {
    color: #57534e;
}

[data-theme="light"] .auth-footer-link a,
[data-theme="light"] .auth-footer-link .text-white-50 {
    color: #57534e !important;
}

/* Auth top bar: theme + language (all auth pages) */
.auth-switchers-bar {
    position: fixed;
    top: 1rem;
    inset-inline-end: 1rem;
    inset-inline-start: auto;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.625rem 0.375rem 0.5rem;
    background: rgba(15, 12, 8, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px;
    border: 1px solid rgba(244, 192, 37, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

[dir="rtl"] .auth-switchers-bar {
    padding: 0.375rem 0.5rem 0.375rem 0.625rem;
}

[data-theme="light"] .auth-switchers-bar {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(180, 83, 9, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.auth-switchers-bar .auth-theme-btn {
    width: 2.375rem;
    height: 2.375rem;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: rgba(244, 192, 37, 0.18);
    color: var(--auth-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-switchers-bar .auth-theme-btn:hover {
    background: rgba(244, 192, 37, 0.32);
    transform: scale(1.06);
}

.auth-switchers-bar .auth-theme-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

[data-theme="light"] .auth-switchers-bar .auth-theme-btn {
    background: rgba(180, 83, 9, 0.12);
    color: #b45309;
}

[data-theme="light"] .auth-switchers-bar .auth-theme-btn:hover {
    background: rgba(180, 83, 9, 0.22);
}

.auth-switchers-bar .auth-lang-toggle-btn {
    cursor: pointer;
    padding: 0;
    border: none;
    background: transparent;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.auth-switchers-bar .auth-lang-toggle-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 3px;
    border-radius: 9999px;
}

/* Language pill – auth-specific (works on sky in dark + light) */
.auth-switchers-bar .language-toggle-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 4.25rem;
    height: 1.75rem;
    padding: 0 0.2rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(244, 192, 37, 0.3);
    overflow: hidden;
}

[data-theme="light"] .auth-switchers-bar .language-toggle-pill {
    background: rgba(180, 83, 9, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(180, 83, 9, 0.22);
}

.auth-switchers-bar .language-option {
    position: relative;
    z-index: 2;
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.55);
    transition: color 0.2s ease;
    user-select: none;
}

[data-theme="light"] .auth-switchers-bar .language-option {
    color: rgba(87, 83, 78, 0.55);
}

.auth-switchers-bar .language-toggle-pill.is-fa .language-option-fa,
.auth-switchers-bar .language-toggle-pill.is-en .language-option-en {
    color: #1c1917;
}

[data-theme="light"] .auth-switchers-bar .language-toggle-pill.is-fa .language-option-fa,
[data-theme="light"] .auth-switchers-bar .language-toggle-pill.is-en .language-option-en {
    color: #fff;
}

.auth-switchers-bar .language-toggle-knob {
    position: absolute;
    top: 2px;
    inset-inline-start: 3px;
    width: calc(50% - 4px);
    height: calc(100% - 4px);
    border-radius: 9999px;
    background: linear-gradient(180deg, #fde68a 0%, var(--auth-primary) 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
    transform: none;
    transition: inset-inline-start 0.25s ease, background 0.2s ease;
}

[data-theme="light"] .auth-switchers-bar .language-toggle-knob {
    background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%);
}

.auth-switchers-bar .language-toggle-pill.is-en .language-toggle-knob {
    inset-inline-start: calc(50% + 1px);
}

.auth-switchers-bar .auth-lang-toggle-btn:hover .language-toggle-pill {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(244, 192, 37, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .auth-switchers-bar .auth-lang-toggle-btn:hover .language-toggle-pill {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(180, 83, 9, 0.4), 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 576px) {
    .auth-switchers-bar {
        top: 0.75rem;
        inset-inline-end: 0.75rem;
        gap: 0.5rem;
        padding: 0.3rem 0.5rem;
    }

    .auth-switchers-bar .auth-theme-btn {
        width: 2.125rem;
        height: 2.125rem;
        font-size: 0.9rem;
    }

    .auth-switchers-bar .language-toggle-pill {
        width: 3.75rem;
        height: 1.625rem;
    }

    .auth-switchers-bar .language-option {
        font-size: 0.62rem;
    }
}

/* Guest path home — lodge crest (top-start) + moonlit trail (bottom) */
.auth-lodge-portal {
    position: fixed;
    top: 1rem;
    inset-inline-start: 1rem;
    inset-inline-end: auto;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    background: rgba(15, 12, 8, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px;
    border: 1px solid rgba(244, 192, 37, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    color: var(--auth-primary);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

[dir="rtl"] .auth-lodge-portal {
    padding: 0.35rem 0.4rem 0.35rem 0.65rem;
}

.auth-lodge-portal:hover,
.auth-lodge-portal:focus-visible {
    text-decoration: none;
    color: #fde68a;
    transform: translateY(-1px);
    border-color: rgba(244, 192, 37, 0.55);
    box-shadow: 0 10px 28px rgba(244, 192, 37, 0.18), 0 8px 24px rgba(0, 0, 0, 0.32);
    outline: none;
}

[data-theme="light"] .auth-lodge-portal {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(180, 83, 9, 0.28);
    color: #b45309;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.auth-lodge-portal-ring {
    position: absolute;
    inset: -3px;
    border-radius: 9999px;
    border: 1px dashed rgba(244, 192, 37, 0.35);
    animation: auth-portal-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auth-portal-pulse {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.04); }
}

.auth-lodge-portal-logo,
.auth-lodge-portal .site-logo-theme-stack.auth-lodge-portal-logo {
  position: relative;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  overflow: hidden;
  display: inline-block;
}

.auth-lodge-portal-logo:not(.site-logo-theme-stack) {
    object-fit: contain;
    border-radius: 50%;
}

.auth-lodge-portal-label {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-guest-moon-path {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    max-width: min(92vw, 22rem);
    padding: 0.55rem 0.85rem 0.55rem 0.65rem;
    background: rgba(15, 12, 8, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 9999px;
    border: 1px solid rgba(244, 192, 37, 0.4);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 12px 32px rgba(0, 0, 0, 0.35),
        0 0 24px rgba(244, 192, 37, 0.12);
    color: #f5e6c8;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

[dir="rtl"] .auth-guest-moon-path {
    padding: 0.55rem 0.65rem 0.55rem 0.85rem;
}

.auth-guest-moon-path:hover,
.auth-guest-moon-path:focus-visible {
    text-decoration: none;
    color: #fff;
    transform: translateX(-50%) translateY(-2px);
    border-color: rgba(244, 192, 37, 0.65);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 16px 36px rgba(0, 0, 0, 0.4),
        0 0 32px rgba(244, 192, 37, 0.22);
    outline: none;
}

[data-theme="light"] .auth-guest-moon-path {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(180, 83, 9, 0.3);
    color: #44403c;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .auth-guest-moon-path:hover,
[data-theme="light"] .auth-guest-moon-path:focus-visible {
    color: #1c1917;
    border-color: rgba(180, 83, 9, 0.45);
}

.auth-guest-moon-path-trail {
    position: absolute;
    bottom: calc(100% + 0.35rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    pointer-events: none;
}

.auth-guest-moon-path-star {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(244, 192, 37, 0.85);
    box-shadow: 0 0 6px rgba(244, 192, 37, 0.8);
    animation: auth-trail-twinkle 2.4s ease-in-out infinite;
}

.auth-guest-moon-path-star:nth-child(2) { animation-delay: 0.4s; opacity: 0.7; }
.auth-guest-moon-path-star:nth-child(3) { animation-delay: 0.8s; opacity: 0.5; }

@keyframes auth-trail-twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

.auth-guest-moon-path-icon {
    flex-shrink: 0;
    width: 2.125rem;
    height: 2.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(253, 230, 138, 0.35), rgba(244, 192, 37, 0.12));
    border: 1px solid rgba(244, 192, 37, 0.45);
    color: var(--auth-primary);
    font-size: 0.95rem;
}

[data-theme="light"] .auth-guest-moon-path-icon {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.35);
    background: radial-gradient(circle at 35% 30%, rgba(254, 243, 199, 0.9), rgba(251, 191, 36, 0.2));
}

.auth-guest-moon-path-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.25;
}

[dir="rtl"] .auth-guest-moon-path-text {
    align-items: flex-end;
}

.auth-guest-moon-path-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--auth-primary);
}

[data-theme="light"] .auth-guest-moon-path-title {
    color: #b45309;
}

.auth-guest-moon-path-sub {
    font-size: 0.6875rem;
    color: rgba(245, 230, 200, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
}

[data-theme="light"] .auth-guest-moon-path-sub {
    color: #78716c;
}

.auth-guest-moon-path-arrow {
    flex-shrink: 0;
    font-size: 0.75rem;
    opacity: 0.85;
    color: var(--auth-primary);
    transition: transform 0.2s ease;
}

[dir="rtl"] .auth-guest-moon-path-arrow {
    transform: scaleX(-1);
}

.auth-guest-moon-path:hover .auth-guest-moon-path-arrow,
.auth-guest-moon-path:focus-visible .auth-guest-moon-path-arrow {
    transform: translateX(2px);
}

[dir="rtl"] .auth-guest-moon-path:hover .auth-guest-moon-path-arrow,
[dir="rtl"] .auth-guest-moon-path:focus-visible .auth-guest-moon-path-arrow {
    transform: scaleX(-1) translateX(2px);
}

.auth-page:has(.auth-guest-moon-path) .auth-page-body {
    padding-bottom: 4.75rem;
}

.auth-page:has(.auth-guest-moon-path) .auth-page-footer {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom));
}

@media (max-width: 576px) {
    .auth-lodge-portal {
        top: 0.75rem;
        inset-inline-start: 0.75rem;
        padding: 0.25rem;
        gap: 0;
    }

    .auth-lodge-portal-label {
        display: none;
    }

    .auth-lodge-portal-logo {
        width: 1.875rem;
        height: 1.875rem;
    }

    .auth-guest-moon-path {
        max-width: calc(100vw - 1.5rem);
        gap: 0.5rem;
        padding: 0.5rem 0.7rem;
    }

    .auth-guest-moon-path-sub {
        max-width: 11rem;
    }
}

/* Parchment extras – form check, consultant search, social */
.auth-parchment .form-check-label {
    color: var(--auth-text-muted);
    font-size: 0.85rem;
}

.auth-parchment .form-check-label a {
    color: var(--auth-seal-red);
    font-weight: 600;
}

.auth-parchment .form-text {
    color: var(--auth-text-muted);
    font-size: 0.8rem;
}

.auth-parchment .consultant-search-wrapper .input-group-text {
    background: var(--auth-parchment-input-bg);
    border-color: var(--auth-parchment-border);
    color: var(--auth-text-muted);
}

.auth-parchment .consultant-search-wrapper .form-control {
    border-color: var(--auth-parchment-border);
}

.auth-parchment .consultant-search-results {
    background: var(--auth-bg-dark);
    border-color: var(--auth-parchment-border);
    border-radius: 0 0 0.5rem 0.5rem;
    color: var(--auth-text-dark);
}

.auth-parchment .btn-outline-secondary {
    width: 100%;
    border: 1px solid var(--auth-parchment-border);
    color: var(--auth-text-dark);
    background: var(--auth-parchment-surface);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}

.auth-parchment .btn-outline-secondary:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    background: rgba(244, 192, 37, 0.1);
}

.auth-parchment .auth-divider span {
    background: var(--auth-parchment-divider-bg);
    color: var(--auth-text-muted);
}

.auth-parchment .alert-info {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: #1e3a8a;
    border-radius: 0.5rem;
}

.auth-parchment .alert-secondary {
    background: var(--auth-parchment-surface);
    border: 1px solid var(--auth-parchment-border);
    color: var(--auth-text-muted);
    border-radius: 0.5rem;
}

/* ========== Dark mode – parchment, forms, register overrides ========== */
[data-theme="dark"] .auth-parchment-texture {
    opacity: 0.05;
    mix-blend-mode: soft-light;
}

[data-theme="dark"] .auth-parchment {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(244, 192, 37, 0.12);
}

[data-theme="dark"] .auth-parchment h2,
[data-theme="dark"] .auth-parchment .auth-parchment-sub {
    color: var(--auth-text-dark);
}

[data-theme="dark"] .auth-parchment-icon,
[data-theme="dark"] .auth-parchment .text-secondary {
    color: var(--auth-text-muted) !important;
}

[data-theme="dark"] .auth-parchment .text-muted,
[data-theme="dark"] .auth-parchment .form-text {
    color: var(--auth-text-muted) !important;
}

[data-theme="dark"] .auth-parchment .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 2px rgba(244, 192, 37, 0.22);
    background: rgba(12, 10, 7, 0.8);
}

[data-theme="dark"] .auth-parchment .form-check-input {
    background-color: rgba(12, 10, 7, 0.65);
    border-color: rgba(244, 192, 37, 0.35);
}

[data-theme="dark"] .auth-parchment .form-check-label {
    color: var(--auth-text-muted);
}

[data-theme="dark"] .auth-parchment .form-check-label a {
    color: var(--auth-seal-red);
}

[data-theme="dark"] .auth-parchment .alert-info {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(96, 165, 250, 0.35);
    color: #bfdbfe;
}

[data-theme="dark"] .auth-parchment .alert-success {
    background: rgba(22, 101, 52, 0.22);
    border-color: rgba(74, 222, 128, 0.35);
    color: #bbf7d0;
}

[data-theme="dark"] .auth-parchment .alert-danger {
    background: rgba(185, 28, 28, 0.22);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fecaca;
}

[data-theme="dark"] .auth-parchment .consultant-search-item {
    color: var(--auth-text-dark);
    border-color: rgba(244, 192, 37, 0.12);
}

[data-theme="dark"] .auth-parchment .consultant-search-item:hover,
[data-theme="dark"] .auth-parchment .consultant-search-item.active {
    background: rgba(244, 192, 37, 0.2);
    color: var(--auth-text-dark);
}

[data-theme="dark"] .auth-page .auth-parchment .form-control,
[data-theme="dark"] .auth-page .auth-parchment .form-label {
    color: var(--auth-text-dark);
}

[data-theme="dark"] .auth-intro h1 {
    color: var(--auth-primary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .auth-role-picker-label {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .auth-role-segment-title {
    color: #f5f5f4;
}

[data-theme="dark"] .auth-page-footer {
    background: linear-gradient(to top, rgba(15, 12, 8, 0.88), rgba(15, 12, 8, 0));
}

[data-theme="dark"] .auth-parchment .strength-bar {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .auth-parchment {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
}

/* ========== Password toggle – RTL-safe (overrides register.css / login.css) ========== */
.auth-page .password-input-wrapper {
    position: relative;
}

/* Password fields without a leading icon (fallback) */
.auth-page .password-input-wrapper:not(.input-icon-wrap) .form-control {
    padding-inline-end: 3.25rem !important;
    padding-inline-start: 1rem !important;
    padding-left: unset !important;
    padding-right: unset !important;
}

.auth-page .password-toggle {
    position: absolute;
    inset-inline-end: 0.4rem;
    inset-inline-start: auto;
    top: 50%;
    transform: translateY(-50%);
    height: 2.25rem;
    width: 2.25rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--auth-text-muted, #78716c);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
    z-index: 2;
}

/* Physical fallback when logical props are overridden by older cached CSS */
html[dir="ltr"] .auth-page .password-toggle {
    right: 0.4rem !important;
    left: auto !important;
}

html[dir="rtl"] .auth-page .password-toggle {
    left: 0.4rem !important;
    right: auto !important;
}

.auth-page .password-toggle:hover {
    color: var(--auth-primary, #f4c025);
    background: rgba(244, 192, 37, 0.12);
}

.auth-page .password-toggle:focus-visible {
    outline: 2px solid rgba(244, 192, 37, 0.45);
    outline-offset: 1px;
}

.auth-door .password-toggle {
    color: #a8a29e;
}

.auth-door .password-toggle:hover {
    color: var(--auth-primary);
    background: rgba(244, 192, 37, 0.1);
}

[data-theme="light"] .auth-door .password-toggle {
    color: #78716c;
}

[data-theme="light"] .auth-door .password-toggle:hover {
    color: #b45309;
    background: rgba(180, 83, 9, 0.08);
}

.auth-parchment .password-toggle:hover {
    color: var(--auth-seal-red);
    background: rgba(139, 35, 35, 0.08);
}

/* Login + signup: lock icon + eye toggle — same text inset as email */
.auth-page .password-input-wrapper.input-icon-wrap .form-control {
    padding-inline-start: 3rem !important;
    padding-inline-end: 3.25rem !important;
    padding-left: unset !important;
    padding-right: unset !important;
}

html[dir="ltr"] .auth-page .password-input-wrapper.input-icon-wrap .form-control {
    padding-left: 3rem !important;
    padding-right: 3.25rem !important;
}

html[dir="rtl"] .auth-page .password-input-wrapper.input-icon-wrap .form-control {
    padding-right: 3rem !important;
    padding-left: 3.25rem !important;
}

.auth-parchment .form-control.is-invalid,
.auth-door .form-control.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.auth-parchment .form-control.is-valid,
.auth-door .form-control.is-valid {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}

.auth-parchment .text-danger,
.auth-door .text-danger {
    font-size: 0.8125rem;
    margin-top: 0.35rem;
}

