/* ============================================================
   RS PERFORMANCE — AUTH PAGES  (rs-auth.css)
   Login / Register / Forgot Password / Reset Password
   ============================================================ */

/* ---- Tokens ---- */
:root {
    --bg:        #060d17;
    --surface:   #0b1525;
    --panel:     #0f1d30;
    --rim:       rgba(255,255,255,0.055);
    --rim2:      rgba(255,255,255,0.10);
    --red:       #e8192c;
    --red-dim:   rgba(232,25,44,0.12);
    --red-glow:  rgba(232,25,44,0.3);
    --teal:      #00c8a0;
    --teal-dim:  rgba(0,200,160,0.10);
    --teal-glow: rgba(0,200,160,0.3);
    --amb:       #f5a623;
    --amb-dim:   rgba(245,166,35,0.10);
    --white:     #cfe3f5;
    --txt:       #6b8aaa;
    --txt2:      #9db8d2;
    --mono:      'JetBrains Mono', monospace;
    --head:      'Rajdhani', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body.rs-auth {
    font-family: var(--head);
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ============================================================
   SPLIT LAYOUT
   ============================================================ */
.rs-auth-wrap {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ---- Form Panel (left) ---- */
.rs-auth-panel {
    width: 460px;
    min-width: 460px;
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--rim);
    display: flex;
    flex-direction: column;
    padding: 40px 52px 40px 48px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Corner clip removed */

/* Vertical accent line */
.rs-auth-panel::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--red) 0%, transparent 60%);
}

/* ---- Image Panel (right) ---- */
.rs-auth-image {
    flex: 1;
    background-color: var(--panel);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.rs-auth-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6,13,23,0.75) 0%, rgba(6,13,23,0.25) 100%);
    z-index: 1;
}

/* Brand text over image */
.rs-auth-image-brand {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 2;
    color: rgba(207,227,245,0.45);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    line-height: 2;
}

.rs-auth-image-brand strong {
    display: block;
    font-size: 22px;
    color: rgba(207,227,245,0.7);
    font-family: var(--head);
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 4px;
}

/* ============================================================
   PANEL COMPONENTS
   ============================================================ */

/* ---- Topbar (controls top-right only) ---- */
.rs-auth-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    margin-bottom: 0;
}

/* ---- Logo (centered, right above title) ---- */
.rs-auth-logo {
    display: block;
    align-self: center;
    margin-top: auto;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.rs-auth-logo img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 8px var(--red-glow));
}

html[data-theme="light"] .rs-auth-logo img {
    filter: drop-shadow(0 2px 6px rgba(10,40,80,0.18));
}

/* ---- Language Selector ---- */
.rs-auth-lang {
    position: relative;
    z-index: 10;
}

.rs-auth-lang-btn {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--txt);
    background: var(--surface);
    border: 1px solid var(--rim2);
    padding: 6px 10px 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    white-space: nowrap;
}
.rs-auth-lang-btn:hover {
    border-color: var(--teal);
    color: var(--white);
    background: var(--panel);
}

/* Flag SVG inside button — constrain size */
.rs-auth-lang-btn .lang-flag svg,
.rs-auth-lang-btn .lang-flag img {
    display: block;
    width: 18px !important;
    height: auto !important;
}

/* Chevron */
.rs-auth-lang-btn .lang-chevron {
    margin-left: 2px;
    opacity: 0.45;
    transition: transform 0.2s, opacity 0.2s;
}
.rs-auth-lang-btn:hover .lang-chevron { opacity: 0.9; }
.rs-auth-lang-dropdown.open ~ * .lang-chevron,
.rs-auth-lang[data-open] .lang-chevron { transform: rotate(180deg); opacity: 0.9; }

.rs-auth-lang-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--panel);
    border: 1px solid var(--rim2);
    border-top: 2px solid var(--teal);
    min-width: 200px;
    display: none;
    z-index: 200;
    box-shadow: 0 16px 48px rgba(0,0,0,0.7);
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--rim2) transparent;
}
.rs-auth-lang-dropdown.open { display: block; }

.rs-auth-lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--txt);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--rim);
}
.rs-auth-lang-dropdown a:last-child { border-bottom: none; }

/* Flag SVG inside dropdown items */
.rs-auth-lang-dropdown a svg,
.rs-auth-lang-dropdown a img {
    width: 18px !important;
    height: auto !important;
    flex-shrink: 0;
}

.rs-auth-lang-dropdown a:hover {
    background: rgba(0, 200, 160, 0.08);
    color: var(--white);
}

/* ---- Title ---- */
.rs-auth-head {
    margin-bottom: 28px;
}

.rs-auth-title {
    font-family: var(--head);
    font-size: 26px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.rs-auth-title .rs-slash { color: var(--red); font-weight: 700; margin-right: 4px; }

.rs-auth-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--txt);
    letter-spacing: 1.5px;
    line-height: 1.7;
}

.rs-auth-meta a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.2s;
}

.rs-auth-meta a:hover { color: var(--white); }

/* ---- Alerts ---- */
.rs-auth-alert {
    font-family: var(--mono);
    font-size: 12px;
    padding: 10px 14px;
    border-left: 3px solid;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.rs-auth-alert.success, .rs-auth-alert.alert-success {
    background: rgba(0,200,160,0.07);
    border-color: var(--teal);
    color: var(--teal);
}
.rs-auth-alert.danger, .rs-auth-alert.alert-danger {
    background: var(--red-dim);
    border-color: var(--red);
    color: #ff8091;
}
.rs-auth-alert.warning, .rs-auth-alert.alert-warning {
    background: var(--amb-dim);
    border-color: var(--amb);
    color: var(--amb);
}
.rs-auth-alert.info, .rs-auth-alert.alert-info {
    background: var(--teal-dim);
    border-color: var(--teal);
    color: var(--txt2);
}

/* ---- Type Selector (Personal / Business) ---- */
.rs-auth-type {
    display: flex;
    border: 1px solid var(--rim);
    margin-bottom: 20px;
    overflow: hidden;
}

.rs-auth-type-btn {
    flex: 1;
    padding: 9px 8px;
    background: none;
    border: none;
    color: var(--txt);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.rs-auth-type-btn + .rs-auth-type-btn {
    border-left: 1px solid var(--rim);
}

.rs-auth-type-btn.active {
    background: var(--red-dim);
    color: var(--red);
    font-weight: 600;
}

/* ---- Form Fields ---- */
.rs-form { flex: none; }

.rs-field {
    position: relative;
    margin-bottom: 14px;
}

.rs-field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--txt);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

/* For textarea, icon at top */
.rs-field.rs-field-textarea .rs-field-icon {
    top: 14px;
    transform: none;
}

.rs-field input,
.rs-field select,
.rs-field textarea {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--rim);
    color: var(--white);
    font-family: var(--head);
    font-size: 15px;
    font-weight: 500;
    padding: 11px 14px 11px 42px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    letter-spacing: 0.3px;
}

.rs-field input:focus,
.rs-field select:focus,
.rs-field textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-dim);
}

.rs-field input::placeholder,
.rs-field textarea::placeholder { color: var(--txt); }

.rs-field input[readonly] {
    color: var(--txt);
    cursor: default;
    background: var(--bg);
}

.rs-field select { cursor: pointer; color: var(--white); }
.rs-field select option { background: var(--panel); color: var(--white); }
.rs-field select:invalid { color: var(--txt); }

.rs-field textarea {
    resize: vertical;
    min-height: 80px;
    padding-top: 12px;
}

/* No icon */
.rs-field.no-icon input,
.rs-field.no-icon select,
.rs-field.no-icon textarea { padding-left: 14px; }

/* Password eye toggle */
.rs-field-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--txt);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.rs-field-eye:hover { color: var(--teal); }

/* intlTelInput override */
.iti { width: 100%; }
.iti__flag-container { z-index: 50; }

/* Selected flag button */
.iti__selected-flag {
    background: var(--panel) !important;
    border-right: 1px solid var(--rim2) !important;
    padding: 0 10px !important;
    gap: 6px;
}
.iti__selected-flag:hover,
.iti__selected-flag:focus { background: var(--rim) !important; outline: none; }

.iti__selected-dial-code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--txt2);
    margin-left: 4px;
}

.iti__arrow {
    border-top-color: var(--txt) !important;
    margin-left: 4px;
}
.iti__arrow--up { border-bottom-color: var(--txt) !important; border-top-color: transparent !important; }

/* Dropdown list */
.iti__country-list {
    background: var(--panel);
    border: 1px solid var(--rim2);
    border-top: 2px solid var(--teal);
    box-shadow: 0 16px 48px rgba(0,0,0,0.7);
    z-index: 9999 !important;
    max-height: 240px;
    scrollbar-width: thin;
    scrollbar-color: var(--rim2) transparent;
}

/* Country item */
.iti__country {
    display: flex;
    align-items: center;
    padding: 8px 12px !important;
    border-bottom: 1px solid var(--rim);
    transition: background 0.12s;
}
.iti__country:last-child { border-bottom: none; }

.iti__country:hover,
.iti__country.iti__highlight {
    background: rgba(0,200,160,0.08) !important;
}

.iti__country-name {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--txt2);
    margin-right: 6px;
}

.iti__dial-code {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--txt);
}

/* Divider between preferred & all countries */
.iti__divider {
    border-bottom: 1px solid var(--rim2) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Light mode */
html[data-theme="light"] .iti__country-list {
    background: var(--surface);
    border-color: var(--rim2);
    box-shadow: 0 12px 40px rgba(10,40,80,0.15);
}
html[data-theme="light"] .iti__selected-flag { background: var(--panel) !important; }
html[data-theme="light"] .iti__country:hover,
html[data-theme="light"] .iti__country.iti__highlight { background: rgba(0,200,160,0.10) !important; }

/* Divider */
.rs-auth-divider {
    height: 1px;
    background: var(--rim);
    margin: 18px 0;
}

/* ---- Submit Button ---- */
.rs-auth-btn {
    width: 100%;
    padding: 12px;
    background: var(--teal);
    color: #060d17;
    border: none;
    font-family: var(--head);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s, box-shadow 0.2s;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
    border-radius: 0;
}

.rs-auth-btn:hover {
    background: #00ddb2;
    box-shadow: 0 0 24px var(--teal-glow);
}

.rs-auth-btn:active { transform: translateY(1px); }

/* ---- Terms Checkbox ---- */
.rs-auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
}

.rs-auth-check input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    accent-color: var(--teal);
    margin-top: 2px;
    cursor: pointer;
}

.rs-auth-check-label {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--txt);
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.rs-auth-check-label a {
    color: var(--teal);
    text-decoration: none;
    cursor: pointer;
}

.rs-auth-check-label a:hover { color: var(--white); }

/* ---- Misc Links ---- */
.rs-auth-link {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--txt);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.rs-auth-link:hover { color: var(--teal); }

/* ---- Footer ---- */
.rs-auth-footer {
    margin-top: auto;
    padding-top: 20px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--txt);
    letter-spacing: 1px;
    flex-shrink: 0;
}

/* ---- Maker (producer signature) ---- */
.rs-auth-maker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--rim);
    margin-top: 12px;
    flex-shrink: 0;
}

.rs-auth-maker-label {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--txt);
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0.7;
}

.rs-auth-maker a { display: flex; align-items: center; }

.rs-auth-maker img {
    height: 18px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.rs-auth-maker a:hover img { opacity: 1; }

/* ============================================================
   MODAL (Terms & Conditions)
   ============================================================ */
.rs-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.rs-modal-overlay.open { display: flex; }

.rs-modal {
    background: var(--surface);
    border: 1px solid var(--rim2);
    border-top: 2px solid var(--teal);
    max-width: 640px;
    width: 92%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.rs-modal-head {
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--rim);
    font-family: var(--head);
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rs-modal-close {
    background: none;
    border: none;
    color: var(--txt);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: color 0.2s;
}
.rs-modal-close:hover { color: var(--white); }

.rs-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    font-family: var(--head);
    font-size: 14px;
    color: var(--txt2);
    line-height: 1.7;
    flex: 1;
}

.rs-modal-foot {
    padding: 14px 24px;
    border-top: 1px solid var(--rim);
    display: flex;
    justify-content: flex-end;
}

.rs-modal-foot button {
    padding: 9px 28px;
    background: var(--teal);
    color: #060d17;
    border: none;
    font-family: var(--head);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}

/* ============================================================
   REGISTER: company fields
   ============================================================ */
.rs-company-fields { display: none; }
.rs-company-fields.show { display: block; }

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.rs-auth-theme-btn {
    background: var(--surface);
    border: 1px solid var(--rim2);
    color: var(--txt);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    z-index: 10;
}
.rs-auth-theme-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--panel);
}
.rs-auth-theme-btn svg { display: block; transition: opacity 0.2s; }
.rs-auth-theme-btn .rs-icon-sun  { display: none; }
.rs-auth-theme-btn .rs-icon-moon { display: block; }
html[data-theme="light"] .rs-auth-theme-btn .rs-icon-sun  { display: block; }
html[data-theme="light"] .rs-auth-theme-btn .rs-icon-moon { display: none; }

/* ============================================================
   LIGHT MODE — TOKEN OVERRIDES
   ============================================================ */
html[data-theme="light"] {
    --bg:       #cdd8e6;
    --surface:  #e8f0f9;
    --panel:    #dde8f3;
    --rim:      rgba(10,40,80,0.12);
    --rim2:     rgba(10,40,80,0.22);
    --rim3:     rgba(10,40,80,0.34);
    --white:    #040d1a;
    --txt:      #3d5a72;
    --txt2:     #142438;
    /* accent colours intentionally unchanged */
}

/* Light mode component adjustments */
html[data-theme="light"] body.rs-auth {
    background: var(--bg);
    color: var(--white);
}

html[data-theme="light"] .rs-auth-panel {
    background: var(--surface);
    border-right-color: var(--rim2);
    box-shadow: 4px 0 24px rgba(10,40,80,0.10);
}

/* Corner clip — must match new --bg */
html[data-theme="light"] .rs-auth-panel::before {
    border-color: transparent var(--bg) transparent transparent;
}

/* Form inputs */
html[data-theme="light"] .rs-field input,
html[data-theme="light"] .rs-field select,
html[data-theme="light"] .rs-field textarea {
    background: #f5f9ff;
    color: var(--white);
    border-color: var(--rim2);
    box-shadow: inset 0 1px 3px rgba(10,40,80,0.08);
}
html[data-theme="light"] .rs-field input::placeholder,
html[data-theme="light"] .rs-field textarea::placeholder { color: var(--txt); }
html[data-theme="light"] .rs-field input[readonly] {
    background: var(--panel);
    color: var(--txt);
}
html[data-theme="light"] .rs-field select option { background: #f5f9ff; color: var(--white); }

/* Auth title slash colour stays red */
html[data-theme="light"] .rs-auth-title { color: var(--white); }

/* Alert messages */
html[data-theme="light"] .rs-auth-alert.error {
    background: rgba(232,25,44,0.08);
    border-color: rgba(232,25,44,0.3);
    color: #b00017;
}
html[data-theme="light"] .rs-auth-alert.success {
    background: rgba(0,200,160,0.08);
    border-color: rgba(0,200,160,0.3);
    color: #007a60;
}

/* Language dropdown */
html[data-theme="light"] .rs-auth-lang-dropdown {
    background: var(--surface);
    border-color: var(--rim2);
    box-shadow: 0 12px 40px rgba(10,40,80,0.18);
}
html[data-theme="light"] .rs-auth-lang-dropdown a:hover {
    background: rgba(0,200,160,0.10);
    color: var(--white);
}

/* Personal/Business type toggle */
html[data-theme="light"] .rs-auth-type-btn { color: var(--txt); }
html[data-theme="light"] .rs-auth-type-btn.active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

/* Image panel brand overlay text */
html[data-theme="light"] .rs-auth-image-brand { color: rgba(255,255,255,0.85); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .rs-auth-panel {
        width: 400px;
        min-width: 400px;
        padding: 36px 36px 36px 36px;
    }
}

@media (max-width: 640px) {
    .rs-auth-image { display: none; }

    .rs-auth-panel {
        width: 100%;
        min-width: 100%;
        padding: 32px 24px;
    }

    .rs-auth-panel::after { display: none; }
}
