﻿/* ============================================================
   INVOSAN — Auth Pages (Login / Register)
   Premium Design v1.0
   ============================================================ */

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --brand-primary: #0EA5E9;
    --brand-primary-light: #38BDF8;
    --brand-secondary: #38BDF8;
    --brand-gradient: linear-gradient(135deg, #0EA5E9, #38BDF8, #38BDF8);
    --brand-gradient-hover: linear-gradient(135deg, #0284C7, #0891B2, #0EA5E9);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

/* Light theme */
[data-theme="light"] {
    --bg-body: #F8FAFF;
    --bg-card: #FFFFFF;
    --bg-input: rgba(99, 120, 255, 0.04);
    --bg-input-hover: rgba(99, 120, 255, 0.07);
    --border-color: rgba(99, 120, 255, 0.12);
    --border-hover: rgba(14, 165, 233, 0.25);
    --border-focus: rgba(14, 165, 233, 0.5);
    --text-primary: #1E293B;
    --text-secondary: #5B6B82;
    --text-tertiary: #94A3B8;
    --visual-bg: linear-gradient(135deg, #0EA5E9 0%, #38BDF8 40%, #38BDF8 100%);
}

/* Dark theme */
[data-theme="dark"] {
    --bg-body: #0B0D17;
    --bg-card: #111425;
    --bg-input: rgba(22, 27, 51, 0.8);
    --bg-input-hover: rgba(28, 34, 62, 0.9);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-focus: rgba(14, 165, 233, 0.5);
    --text-primary: #F1F3F9;
    --text-secondary: #8B92A8;
    --text-tertiary: #5A6077;
    --visual-bg: linear-gradient(135deg, #1a1c3a 0%, #2a2d5a 40%, #1a3a5a 100%);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: var(--font-primary);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    min-height: 100vh;
    transition: background var(--transition-slow), color var(--transition-slow);
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--text-primary); outline: none; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(14,165,233,0.2); border-radius: 9999px; }

/* ============================================================
   AUTH LAYOUT — Split Screen
   ============================================================ */
.auth-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Mobile Header (hidden on desktop) ─────────────────── */
.auth-mobile-header {
    display: none;
}

/* ─── Left Panel: Visual ────────────────────────────────── */
.auth-visual {
    flex: 0 0 50%;
    position: relative;
    background: var(--visual-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.visual-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.visual-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}
.visual-orb-1 {
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.08);
    top: -100px; right: -80px;
    animation: orbFloat 20s ease-in-out infinite;
}
.visual-orb-2 {
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.06);
    bottom: -60px; left: -60px;
    animation: orbFloat 25s ease-in-out infinite reverse;
}
.visual-orb-3 {
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.04);
    top: 50%; left: 30%;
    animation: orbFloat 30s ease-in-out infinite;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -15px) scale(1.05); }
    50% { transform: translate(-15px, 20px) scale(0.95); }
    75% { transform: translate(10px, 10px) scale(1.02); }
}
.visual-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
}
.visual-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    min-height: 100%;
}
.visual-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}
.visual-logo img.auth-logo-img {
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}
.visual-text {
    max-width: 420px;
}
.visual-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    overflow-wrap: break-word;
    word-break: break-word;
}
.visual-text p {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.7;
}

/* Security Highlights */
.security-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.security-highlight {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    transition: all var(--transition-base);
}
.security-highlight:hover {
    background: rgba(255,255,255,0.12);
    transform: translateX(4px);
}
.sh-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.sh-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}
.sh-content strong {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.sh-content span {
    font-size: 0.7rem;
    opacity: 0.65;
    line-height: 1.4;
}

/* ─── Right Panel: Forms ────────────────────────────────── */
.auth-panel {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: var(--bg-body);
    overflow-y: auto;
}
.auth-panel-inner {
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

/* Top bar */
.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.auth-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}
.auth-back:hover { color: var(--brand-primary); }

/* Auth top right wrapper */
.auth-top-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Language Switcher */
.lang-switch {
    display: inline-flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full, 9999px);
    padding: 2px;
    gap: 0;
}
.lang-option {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full, 9999px);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.2;
}
.lang-option:hover {
    color: var(--text-primary);
}
.lang-option.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(14,165,233,0.3);
}

.theme-toggle-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.theme-toggle-btn:hover { background: rgba(14,165,233,0.08); color: var(--brand-primary); }

/* ─── Tabs ──────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    position: relative;
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 2rem;
}
.auth-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    z-index: 2;
    color: var(--text-secondary);
}
.auth-tab.active {
    color: var(--text-primary);
}
.auth-tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
    z-index: 1;
}
.auth-tabs[data-active="register"] .auth-tab-indicator {
    transform: translateX(100%);
}

/* ─── Form ──────────────────────────────────────────────── */
.auth-form {
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.form-header {
    margin-bottom: 1.5rem;
}
.form-header h2 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
    overflow-wrap: break-word;
    word-break: break-word;
}
.form-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper > i:first-child {
    position: absolute;
    left: 0.875rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color var(--transition-fast);
}
.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.75rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.input-wrapper input::placeholder { color: var(--text-tertiary); }
.input-wrapper input:hover,
.input-wrapper select:hover {
    border-color: var(--border-hover);
    background: var(--bg-input-hover);
}
.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
    background: var(--bg-card);
}
.input-wrapper input:focus ~ i:first-child,
.input-wrapper:focus-within > i:first-child {
    color: var(--brand-primary);
}
.select-wrapper select {
    appearance: none;
    cursor: pointer;
}
.select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0.875rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    pointer-events: none;
}

/* ─── Phone Input ────────────────────────────────────────── */
.phone-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    overflow: visible;
}
.phone-input-wrapper:hover {
    border-color: var(--border-hover);
    background: var(--bg-input-hover);
}
.phone-input-wrapper:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
    background: var(--bg-card);
}

.phone-country-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem 0.75rem 0.75rem;
    background: none;
    border: none;
    border-right: 1.5px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    min-width: 90px;
}
.phone-country-btn:hover {
    background: rgba(14, 165, 233, 0.06);
}
.country-flag {
    font-size: 1.25rem;
    line-height: 1;
}
.country-code {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-primary);
}
.phone-chevron {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
    margin-left: 0.125rem;
}
.phone-country-btn[aria-expanded="true"] .phone-chevron {
    transform: rotate(180deg);
}
.phone-number-input {
    flex: 1;
    padding: 0.75rem 0.875rem;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
    font-family: var(--font-primary);
    letter-spacing: 0.02em;
}
.phone-number-input::placeholder {
    color: var(--text-tertiary);
}

/* Country Dropdown */
.phone-country-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-base);
    max-height: 0;
    overflow: hidden;
}
.phone-country-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 320px;
}
[data-theme="dark"] .phone-country-dropdown {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
}
.phone-country-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.phone-country-search i {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}
.phone-country-search input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 0.825rem;
    color: var(--text-primary);
    outline: none;
}
.phone-country-search input::placeholder {
    color: var(--text-tertiary);
}
.phone-country-list {
    list-style: none;
    padding: 0.375rem 0;
    margin: 0;
    max-height: 248px;
    overflow-y: auto;
}
.phone-country-list::-webkit-scrollbar {
    width: 4px;
}
.phone-country-list::-webkit-scrollbar-thumb {
    background: rgba(14,165,233,0.15);
    border-radius: 9999px;
}
.phone-country-list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 0.85rem;
}
.phone-country-list li:hover {
    background: rgba(14, 165, 233, 0.06);
}
.phone-country-list li.selected {
    background: rgba(14, 165, 233, 0.08);
    font-weight: 500;
}
.phone-country-list li .flag {
    font-size: 1.15rem;
    flex-shrink: 0;
}
.phone-country-list li .name {
    flex: 1;
    color: var(--text-primary);
}
.phone-country-list li .dial {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-family: var(--font-primary);
}
.phone-country-list li.hidden {
    display: none;
}

/* Phone Hint */
.phone-hint {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}
.phone-hint i {
    font-size: 0.7rem;
}

/* Phone validation states */
.phone-input-wrapper.valid {
    border-color: #22c55e;
}
.phone-input-wrapper.valid:focus-within {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}
.phone-input-wrapper.invalid {
    border-color: #ef4444;
}
.phone-input-wrapper.invalid:focus-within {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}
.password-toggle:hover { color: var(--brand-primary); background: rgba(14,165,233,0.08); }

/* 2 Column */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Form row (remember me + forgot) */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-secondary);
    margin-bottom: 0.875rem;
    line-height: 1.5;
}
.checkbox-wrapper .checkmark {
    margin-top: 2px;
}
.checkbox-wrapper input[type="checkbox"] {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}
.checkmark {
    width: 18px; height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}
.checkbox-wrapper input:checked + .checkmark {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}
.checkbox-wrapper input:checked + .checkmark::after {
    opacity: 1;
    transform: scale(1);
}
.forgot-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--brand-primary);
    transition: opacity var(--transition-fast);
}
.forgot-link:hover { opacity: 0.8; }
.link {
    color: var(--brand-primary);
    font-weight: 500;
}
.link:hover { text-decoration: underline; }

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}
.strength-bars span {
    height: 3px;
    flex: 1;
    border-radius: 2px;
    background: var(--border-color);
    transition: all var(--transition-base);
}
.strength-bars.weak span:nth-child(1) { background: #EF4444; }
.strength-bars.fair span:nth-child(1),
.strength-bars.fair span:nth-child(2) { background: #F59E0B; }
.strength-bars.good span:nth-child(1),
.strength-bars.good span:nth-child(2),
.strength-bars.good span:nth-child(3) { background: #10B981; }
.strength-bars.strong span { background: #10B981; }
.strength-text {
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}
.strength-text.weak { color: #EF4444; }
.strength-text.fair { color: #F59E0B; }
.strength-text.good { color: #10B981; }
.strength-text.strong { color: #10B981; }

/* ─── Consent Group (Terms + KVKK) ──────────────────────── */
.consent-group {
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    overflow-wrap: break-word;
    word-break: break-word;
}
.consent-group .checkbox-wrapper {
    margin-bottom: 0.75rem;
}
.consent-group .checkbox-wrapper:last-child {
    margin-bottom: 0;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    white-space: nowrap;
}
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(14,165,233,0.25);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    background: var(--brand-gradient-hover);
    box-shadow: 0 4px 16px rgba(14,165,233,0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary .btn-loader { display: none; }
.btn-primary.loading .btn-text { opacity: 0; }
.btn-primary.loading .btn-loader { display: flex; }
.btn-outline {
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.btn-ghost {
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--brand-primary); }

/* Social Login */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.divider span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}
.social-login {
    display: flex;
    gap: 0.75rem;
}
.btn-social {
    flex: 1;
    padding: 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}
.btn-social:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

/* Auth switch */
.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.switch-btn {
    color: var(--brand-primary);
    font-weight: 600;
    transition: opacity var(--transition-fast);
}
.switch-btn:hover { opacity: 0.8; }

/* ─── Success State ─────────────────────────────────────── */
.auth-success {
    text-align: center;
    padding: 2rem 0;
    animation: fadeIn 0.4s ease;
}
.success-icon {
    font-size: 4rem;
    color: #10B981;
    margin-bottom: 1.5rem;
    animation: successPop 0.5s ease;
}
@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.auth-success h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}
.auth-success p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ─── Error Message ─────────────────────────────────────── */
.form-error {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    color: #EF4444;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}
.form-error.show { display: flex; }
.form-error.visible { display: flex; }
.form-error i { flex-shrink: 0; }

/* ─── Rate Limit Warning ───────────────────────────────── */
.rate-limit-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    color: #D97706;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    animation: fadeIn 0.3s ease;
    overflow-wrap: break-word;
    word-break: break-word;
}
.rate-limit-warning i {
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.rate-limit-warning strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
}
.rate-limit-warning span {
    font-size: 0.8rem;
    opacity: 0.85;
}
#cooldown-timer {
    font-weight: 800;
    font-size: 1rem;
    color: #EF4444;
}

/* ─── Password Requirements ────────────────────────────── */
.password-requirements {
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}
.req-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.req-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.req-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}
.req-list li i {
    font-size: 0.6rem;
    width: 14px;
    text-align: center;
    transition: all var(--transition-fast);
}
.req-list li.met {
    color: #10B981;
}
.req-list li.met i {
    font-size: 0.75rem;
    color: #10B981;
}
.req-list li.unmet i {
    color: var(--text-tertiary);
}

/* ─── Security Notice ──────────────────────────────────── */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(14,165,233,0.06);
    border: 1px solid rgba(14,165,233,0.15);
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    overflow-wrap: break-word;
    word-break: break-word;
}
.security-notice i {
    color: var(--brand-primary);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ─── Forgot Password Icon ─────────────────────────────── */
.forgot-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    background: rgba(14,165,233,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}

/* ─── Forgot Success ───────────────────────────────────── */
.forgot-success-content {
    text-align: center;
    padding: 1rem 0;
    animation: fadeIn 0.4s ease;
}
.forgot-success-content .success-icon {
    font-size: 3.5rem;
    color: #10B981;
    margin-bottom: 1.25rem;
    animation: successPop 0.5s ease;
}
.forgot-success-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    overflow-wrap: break-word;
    word-break: break-word;
}
.forgot-success-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.forgot-success-content .security-notice {
    text-align: left;
    margin-bottom: 1.5rem;
}

/* ─── Security Badge ───────────────────────────────────── */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-color);
}
.security-badge i {
    color: #10B981;
    font-size: 0.85rem;
}

/* ─── Toast ─────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
    max-width: calc(100vw - 2rem);
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.success { border-left: 3px solid #10B981; }
.toast.error { border-left: 3px solid #EF4444; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .auth-visual { flex: 0 0 45%; }
    .auth-panel { flex: 0 0 55%; }
    .visual-text h1 { font-size: 2.25rem; }
}

@media (max-width: 768px) {
    .auth-layout {
        flex-direction: column;
        padding-top: 60px;
    }

    /* ─── Mobile Header ─────────────────────────────────── */
    .auth-mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        height: 60px;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        background: var(--bg-body);
        border-bottom: 1px solid var(--border-color);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    [data-theme="light"] .auth-mobile-header {
        background: rgba(248, 250, 255, 0.92);
    }
    [data-theme="dark"] .auth-mobile-header {
        background: rgba(11, 13, 23, 0.92);
    }
    .amh-back {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        color: var(--text-secondary);
        transition: all var(--transition-fast);
        font-size: 0.95rem;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }
    .amh-back:active {
        background: rgba(14,165,233,0.12);
        color: var(--brand-primary);
    }
    .amh-brand {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 1.1rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        color: var(--text-primary);
        min-width: 0;
        overflow: hidden;
    }
    .amh-brand img {
        object-fit: contain;
        flex-shrink: 0;
        width: 24px;
        height: 24px;
    }
    .amh-brand span {
        background: var(--brand-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        white-space: nowrap;
    }
    .amh-actions {
        display: flex;
        align-items: center;
        gap: 0.15rem;
        flex-shrink: 0;
    }
    .amh-actions .lang-switch {
        transform: scale(0.85);
    }
    .amh-actions .theme-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    /* ─── Visual Panel on Mobile ─────────────────────────── */
    .auth-visual {
        flex: none;
        min-height: auto;
        padding: 1.75rem 1.25rem 1.5rem;
    }
    .visual-content {
        padding: 0;
        height: auto;
        gap: 0;
        min-height: auto;
        justify-content: flex-start;
    }
    .visual-logo { display: none; }
    .visual-text {
        text-align: center;
        max-width: 100%;
    }
    .visual-text h1 {
        font-size: 1.375rem;
        margin-bottom: 0.375rem;
    }
    .visual-text p {
        font-size: 0.825rem;
        opacity: 0.75;
    }
    .security-highlights { display: none; }

    /* ─── Form Panel on Mobile ───────────────────────────── */
    .auth-panel {
        flex: none;
        padding: 1.25rem 1.25rem 2rem;
    }
    .auth-panel-inner {
        max-width: 100%;
    }
    .auth-top { display: none; }

    .auth-tabs {
        margin-bottom: 1.25rem;
    }
    .auth-tab {
        min-height: 44px;
        font-size: 0.925rem;
    }

    .form-header {
        margin-bottom: 1.25rem;
    }
    .form-header h2 {
        font-size: 1.375rem;
    }
    .form-header p {
        font-size: 0.85rem;
    }

    /* ─── Inputs Mobile Touch ────────────────────────────── */
    .input-wrapper input,
    .input-wrapper select {
        min-height: 48px;
        font-size: 16px; /* prevents iOS zoom */
        padding: 0.75rem 0.875rem 0.75rem 2.75rem;
    }
    .phone-number-input {
        min-height: 48px;
        font-size: 16px;
    }
    .phone-country-btn {
        min-height: 48px;
    }

    /* ─── Phone dropdown mobile ──────────────────────────── */
    .phone-country-dropdown.open {
        max-height: 280px;
    }
    .phone-country-list li {
        padding: 0.625rem 0.75rem;
        min-height: 44px;
    }
    .phone-country-search input {
        min-height: 40px;
        font-size: 16px;
    }

    /* ─── Buttons Mobile ────────────────────────────────── */
    .btn-lg {
        min-height: 50px;
        font-size: 1rem;
    }
    .btn-block {
        min-height: 50px;
    }

    /* ─── Social Login Mobile ────────────────────────────── */
    .social-login { flex-direction: column; }
    .btn-social {
        min-height: 48px;
        font-size: 0.9rem;
    }

    /* ─── Checkbox Mobile ────────────────────────────────── */
    .checkbox-wrapper {
        font-size: 0.825rem;
        gap: 0.75rem;
        -webkit-tap-highlight-color: transparent;
    }
    .checkmark {
        width: 22px;
        height: 22px;
    }

    /* ─── Consent Group Mobile ───────────────────────────── */
    .consent-group {
        padding: 0.875rem 1rem;
    }

    /* ─── Password Requirements Mobile ───────────────────── */
    .password-requirements {
        padding: 0.75rem;
    }
    .req-list li {
        font-size: 0.78rem;
        min-height: 28px;
        display: flex;
        align-items: center;
    }

    /* ─── Form Rows ──────────────────────────────────────── */
    .form-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .forgot-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* ─── Security Badge ─────────────────────────────────── */
    .security-badge {
        margin-top: 1.5rem;
        padding: 0.875rem;
    }

    /* ─── Toast Mobile ───────────────────────────────────── */
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    /* ─── Rate Limit ─────────────────────────────────────── */
    .rate-limit-warning {
        padding: 0.875rem 1rem;
    }
}

@media (max-width: 480px) {
    .form-row-2col { grid-template-columns: 1fr; }
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .forgot-link {
        align-self: flex-start;
    }
    .auth-panel {
        padding: 1rem 1rem 1.75rem;
    }
    .auth-visual {
        padding: 1.5rem 1rem 1.25rem;
    }
    .visual-text h1 { font-size: 1.25rem; }
    .visual-text p { font-size: 0.8rem; }
    .form-header h2 { font-size: 1.25rem; }
}

/* ─── Touch device improvements ─────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .btn:active { transform: scale(0.97); transition-duration: 100ms; }
    .btn-social:active {
        background: var(--bg-card);
        border-color: var(--brand-primary);
    }
    .btn-social:hover {
        border-color: var(--border-color);
        background: var(--bg-input);
        box-shadow: none;
    }
    .auth-tab:active { opacity: 0.8; }
    .switch-btn:active { opacity: 0.7; }
    .amh-back:hover { background: transparent; color: var(--text-secondary); }
}
