/* ============================================
   OlverseMedia - Global Design System
   Author: OTPL
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary:        #6366f1;
    --primary-dark:   #4f46e5;
    --primary-light:  #818cf8;
    --primary-bg:     #eef2ff;

    --secondary:      #0ea5e9;
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #06b6d4;

    --dark:           #0f172a;
    --dark-2:         #1e293b;
    --dark-3:         #334155;
    --mid:            #64748b;
    --light:          #94a3b8;
    --border:         #e2e8f0;
    --bg:             #f8fafc;
    --white:          #ffffff;

    --font:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius:         10px;
    --radius-lg:      16px;
    --radius-xl:      24px;
    --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:      0 10px 40px rgba(0,0,0,0.12);
    --transition:     all 0.2s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ============================================
   Auth Pages (Login / Register)
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.auth-card-wide { max-width: 640px; }

.auth-header {
    padding: 36px 40px 28px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.auth-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.auth-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--mid);
}

.auth-body { padding: 32px 40px; }

.auth-footer {
    padding: 20px 40px;
    text-align: center;
    background: var(--bg);
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--mid);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-3);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--dark);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-control::placeholder { color: var(--light); }

.form-control.is-error { border-color: var(--danger); }
.form-control.is-success { border-color: var(--success); }

.form-hint {
    font-size: 12px;
    color: var(--mid);
    margin-top: 5px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Input with icon */
.input-group { position: relative; }
.input-group .form-control { padding-left: 42px; }
.input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light);
    font-size: 16px;
    pointer-events: none;
}

/* Password toggle */
.input-group .input-icon-right {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mid);
    cursor: pointer;
    font-size: 16px;
}
.input-group .form-control.has-icon-right { padding-right: 42px; }

/* Phone input with country code */
.phone-group { display: flex; gap: 0; }
.phone-group .country-code {
    padding: 11px 12px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-3);
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}
.phone-group .form-control { border-radius: 0 var(--radius) var(--radius) 0; }

/* Select */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* OTP Input */
.otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.otp-input {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
    font-family: var(--font);
    color: var(--dark);
}

.otp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.otp-input.filled { border-color: var(--primary); background: var(--primary-bg); }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
    color: var(--white);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg);
    color: var(--dark-3);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--dark); }

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,0.4); color: var(--white); }

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: var(--white);
}
.btn-danger:hover { color: var(--white); transform: translateY(0) !important; box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4); }

.btn-block { width: 100%; }

.btn-lg { padding: 14px 32px; font-size: 15px; border-radius: var(--radius-lg); }

.btn:disabled, .btn.loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ============================================
   Section divider
   ============================================ */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    color: var(--mid);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================
   Steps / Progress indicator
   ============================================ */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step.active:not(:last-child)::after,
.step.done:not(:last-child)::after {
    background: var(--primary);
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.step.active .step-dot {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

.step.done .step-dot {
    background: var(--success);
    color: var(--white);
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--light);
    margin-top: 6px;
    text-align: center;
}
.step.active .step-label { color: var(--primary); }
.step.done .step-label   { color: var(--success); }

/* ============================================
   Countdown timer
   ============================================ */
.otp-timer {
    text-align: center;
    font-size: 13px;
    color: var(--mid);
    margin-top: 16px;
}

.otp-timer span { font-weight: 700; color: var(--primary); }

.resend-link {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    border: none;
    background: none;
    font-size: 13px;
    font-family: var(--font);
    padding: 0;
}
.resend-link:hover { text-decoration: underline; }
.resend-link:disabled { color: var(--light); cursor: not-allowed; text-decoration: none; }

/* ============================================
   Checkbox & Radio
   ============================================ */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}
.checkbox-group label { cursor: pointer; font-weight: 400; color: var(--dark-3); font-size: 13px; }

/* ============================================
   Country conditional sections
   ============================================ */
.kyc-section {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 8px;
    display: none;
}
.kyc-section.visible { display: block; }
.kyc-section .kyc-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-3);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    .auth-card { border-radius: var(--radius-lg); }
    .auth-header { padding: 28px 24px 20px; }
    .auth-body { padding: 24px; }
    .auth-footer { padding: 16px 24px; }
    .form-row-2,
    .form-row-3 { grid-template-columns: 1fr; }
    .otp-input { width: 44px; height: 52px; font-size: 20px; }
    .auth-card-wide { max-width: 100%; }
}

@media (max-width: 400px) {
    .otp-group { gap: 6px; }
    .otp-input { width: 40px; height: 48px; font-size: 18px; }
}
