/* =====================================================
   DESIGN TOKENS - DARK THEME ONLY
   ===================================================== */
:root {
    /* slate */
    --slate-50:#f8fafc; --slate-100:#f1f5f9; --slate-200:#e2e8f0;
    --slate-300:#cbd5e1; --slate-400:#94a3b8; --slate-500:#64748b;
    --slate-600:#475569; --slate-700:#334155; --slate-800:#1e293b;
    --slate-900:#0f172a;

    /* emerald / green / teal / cyan */
    --emerald-50:#ecfdf5; --emerald-100:#d1fae5; --emerald-300:#6ee7b7;
    --emerald-400:#34d399; --emerald-500:#10b981; --emerald-600:#059669;
    --emerald-700:#047857; --emerald-900:#064e3b;
    --green-100:#dcfce7; --green-600:#16a34a; --green-900:#14532d;
    --teal-50:#f0fdfa;   --teal-100:#ccfbf1;  --teal-400:#2dd4bf;
    --teal-600:#0d9488;  --teal-900:#134e4a;
    --cyan-100:#cffafe;  --cyan-900:#164e63;
    --amber-400:#fbbf24;
    --red-500:#ef4444;
    --orange-400:#fb923c;

    /* surface (dark theme defaults) */
    --bg:            var(--slate-900);
    --fg:            #f1f5f9;
    --card-bg:       rgba(15,23,42,0.85);
    --card-border:   rgba(51,65,85,0.60);
    --feature-bg:    rgba(30,41,59,0.60);
    --feature-border:rgba(51,65,85,0.50);
    --input-bg:      var(--slate-800);
    --input-border:  var(--slate-700);
    --input-focus-border: rgba(74,222,128,0.30);
    --input-focus-bg:     rgba(100,116,139,0.30);
    --input-text:    var(--emerald-500);
    --label:         var(--slate-300);
    --muted:         var(--slate-400);
    --muted-2:       var(--slate-300);
    --placeholder:   var(--slate-400);
    --badge-bg:      rgba(30,41,59,0.50);
    --grid-line:     rgba(255,255,255,0.03);
    --bg-grad:       linear-gradient(to bottom right, var(--slate-900), var(--slate-800), var(--slate-900));
    --glow:          radial-gradient(circle at 70% 30%, rgba(16,185,129,0.30) 0%, rgba(0,0,0,0) 70%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #f1f5f9;
}

/* === Background effects === */
.fixed-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.gradient-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.08), rgba(2, 44, 34, 0.2));
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(52, 211, 153, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52, 211, 153, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
}

.radial-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 40%, rgba(16, 185, 129, 0.2), transparent 70%);
}

/* === Main container (scroll free) === */
.main-container {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.card-wrapper {
    max-width: 28rem;
    width: 100%;
    margin: 0 auto;
}

/* Glassmorphism card */
.glass-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    border-radius: 1.75rem;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 1.75rem 1.5rem;
    border: 1px solid rgba(51, 65, 85, 0.6);
    transition: all 0.2s ease;
}

/* Header */

.card-header-icon {
    display: inline-flex;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.5rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
}

.icon-box {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box i {
    font-size: 1rem;
    color: white;
}

.card-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.25rem;
}

.card-sub {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Form elements */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.375rem;
    margin-left: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    inset-inline-start: 0.875rem; /* auto handles LTR/RTL */
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
}

.custom-input {
    width: 100%;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 0.875rem;
    padding-inline-start: 2.5rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    padding-inline-end: 1rem;
    font-size: 0.95rem;
    color: #10b981;
    transition: all 0.2s ease;
    outline: none;
}

.custom-input:focus {
    border-color: rgba(16, 185, 129, 0.5);
    background: #0f172a;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.custom-input::placeholder {
    color: #475569;
}

/* Error message */
.error-text {
    position: absolute;
    bottom: -0.25rem;
    left: 0.5rem;
    font-size: 0.7rem;
    color: #f87171;
    display: block;
    font-weight: 500;
}

/* Primary button */
.btn-primary {
    width: 100%;
    background: linear-gradient(95deg, #10b981, #059669, #0d9488);
    border: none;
    padding: 0.85rem 1.25rem;
    border-radius: 0.875rem;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

[dir="rtl"] .btn-primary i {
    transform: scaleX(-1);
    display: inline-block;   /* required for transform to work on inline elements */
}

/* Link styles */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #10b981;
    text-decoration: none;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.back-link:hover {
    color: #34d399;
}

/* RTL */
html[dir="rtl"] .back-link {
    flex-direction: row-reverse;
}

/* step visibility */
.step-hidden {
    display: none;
}

/* Spinner overlay (full page) */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 2.75rem;
    height: 2.75rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   TOAST
   ===================================================== */
.toast-container {
    position: fixed; top: 1.25rem; inset-inline-end: 1.25rem; z-index: 50;
    display: flex; flex-direction: column; gap: 0.75rem;
}
.toast {
    width: 20rem;
    border-radius: 4px;
    border-inline-start: 4px solid transparent;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.10), 0 8px 10px -6px rgba(0,0,0,0.10);
    overflow: hidden;
    background: var(--slate-800);
    color: #f1f5f9;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}
.toast.is-visible { transform: translateX(0); opacity: 1; }
.toast-body {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.75rem 1rem; cursor: pointer;
}
.toast-icon {
    font-size: 1.125rem; line-height: 1.25rem;
    flex-shrink: 0; margin-top: 2px;
}
.toast-icon.t-success { color: var(--emerald-500); }
.toast-icon.t-error   { color: var(--red-500); }
.toast-icon.t-warning { color: var(--orange-400); }
.toast-icon.t-info    { color: var(--slate-500); }
.toast-msg {
    flex: 1; font-size: 0.875rem; line-height: 1.5;
    word-break: break-word;
}
.toast-progress { width: 100%; height: 2px; background: var(--slate-700); }
.toast-progress-bar { height: 100%; background: var(--slate-600); width: 100%; }

/* Responsive */
@media (max-width: 640px) {
    .glass-card {
        padding: 1.5rem 1.25rem;
        border-radius: 1.5rem;
    }
    .card-title {
        font-size: 1.6rem;
    }
    .btn-primary {
        padding: 0.7rem 1rem;
    }
    .custom-input {
        padding: 0.7rem 1rem 0.7rem 2.2rem;
    }
    .toast-item {
        width: 18rem;
    }
}

/* hide desktop logo on mobile? Already using logic: we show mobile logo only when needed. The original design shows mobile-only logo inside each step. We keep the same .md\\:hidden but custom CSS replicates: */
.show-on-mobile {
    display: flex;
}
@media (min-width: 768px) {
    .show-on-mobile {
        display: none;
    }
}

/* Additional spacing for relative container */
.relative-group {
    position: relative;
}
.mt-2 { margin-top: 0.5rem; }
.text-center { text-align: center; }
.pt-1 { padding-top: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.justify-start { justify-content: flex-start; }
.flex { display: flex; }
.w-full { width: 100%; }


/* =====================================================
   RTL SPECIFIC OVERRIDES
   ===================================================== */
html[dir="rtl"] .toast {
    transform: translateX(-100%);
}
html[dir="rtl"] .toast.is-visible {
    transform: translateX(0);
}
html[dir="rtl"] .fa-arrow-left-long {
    transform: rotate(180deg);
}