/* 
 * Authentication Pages CSS 
 * Extracted from login.blade.php 
 */

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

:root {
    --gold: #D4A017;
    --gold-light: #F0C040;
    --gold-pale: #FDF6DC;
    --gold-border: rgba(212,160,23,0.25);
    --text-dark: #1C1C1E;
    --text-mid: #636366;
    --text-soft: #AEAEB2;
    --bg: #FAFAF8;
    --white: #FFFFFF;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-card: 0 2px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
}

html, body {
    height: 100%;
}

body {
    font-family: bakh, -apple-system, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow-x: hidden;
}

/* ── Subtle background pattern ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212,160,23,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(212,160,23,0.07) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* ── Wrapper ── */
.auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 20px 32px;
}

/* ── Top bar ── */
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 0;
    margin-bottom: 8px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-mid);
    font-size: 13px;
    text-decoration: none;
    padding: 8px 12px 8px 8px;
    border-radius: 100px;
    transition: background 0.2s, color 0.2s;
    margin-right: -8px;
}
.back-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-dark); }
.back-btn svg { stroke: currentColor; fill: none; width: 17px; height: 17px; }

.brand-logo {
    height: 30px;
    opacity: 0.85;
    filter: brightness(0);
}

/* placeholder space for centering logo */
.topbar-spacer { width: 80px; }

/* ── Hero section ── */
.auth-hero {
    text-align: center;
    padding: 28px 0 32px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gold-pale);
    border: 1px solid var(--gold-border);
    border-radius: 100px;
    padding: 5px 14px;
    font-size: 12px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}
.auth-badge-dot {
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-mid);
    line-height: 1.7;
}
.auth-subtitle b {
    color: var(--gold);
    font-weight: 700;
}

/* ── Card ── */
.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px 24px;
    flex: 1 0 auto;
}

/* ── Steps ── */
.auth-step { display: none; }
.auth-step.active {
    display: block;
    animation: fadeUp 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Alert box ── */
.auth-alert {
    display: none;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
    text-align: right;
    animation: fadeUp 0.25s ease;
}
.auth-alert.error {
    background: #FFF1F0;
    border: 1px solid #FFCCC7;
    color: #CF1322;
}
.auth-alert.success {
    background: #F6FFED;
    border: 1px solid #B7EB8F;
    color: #389E0D;
}

/* ── Field ── */
.field-group { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-mid);
    margin-bottom: 8px;
    text-align: right;
}

.field-wrap { position: relative; }

.field-input {
    width: 100%;
    height: 52px;
    background: var(--bg);
    border: 1.5px solid #E5E5EA;
    border-radius: var(--radius-md);
    padding: 0 16px;
    font-size: 16px;
    font-family: bakh, sans-serif;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    direction: ltr;
    text-align: center;
    letter-spacing: 2px;
    -webkit-appearance: none;
}
.field-input:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
}
.field-input::placeholder {
    color: var(--text-soft);
    letter-spacing: 0;
}

/* name input */
.field-input.rtl-input {
    direction: rtl;
    text-align: right;
    letter-spacing: 0;
}

/* ── OTP Display ── */
.otp-wrap {
    position: relative;
    margin-bottom: 20px;
}

.otp-real-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 10;
    cursor: text;
    font-size: 16px;
}

.otp-display {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
}

.otp-cell {
    flex: 1;
    max-width: 56px;
    height: 60px;
    background: var(--bg);
    border: 1.5px solid #E5E5EA;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    transition: all 0.2s;
    user-select: none;
    position: relative;
}
.otp-cell.active {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
}
.otp-cell.active::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 16px;
    background: var(--gold);
    border-radius: 2px;
    animation: blink-cursor 1s ease-in-out infinite;
}
.otp-cell.filled {
    border-color: var(--gold);
    background: var(--gold-pale);
}
.otp-cell.otp-error {
    border-color: #FF4D4F !important;
    background: #FFF1F0 !important;
    animation: shake 0.4s ease;
}
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60%  { transform: translateX(-5px); }
    40%, 80%  { transform: translateX(5px); }
}

/* ── Timer ── */
.timer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg);
    border: 1px solid #E5E5EA;
    border-radius: 100px;
    padding: 5px 12px;
    font-size: 12.5px;
    color: var(--text-mid);
    font-weight: 600;
}
.timer-badge svg { stroke: var(--text-soft); fill: none; width: 12px; height: 12px; flex-shrink: 0; }

#btnResend {
    display: none;
    background: none;
    border: none;
    font-family: bakh, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 100px;
    transition: background 0.2s;
}
#btnResend:hover { background: var(--gold-pale); }

/* ── Buttons ── */
.btn-primary {
    width: 100%;
    height: 52px;
    background: var(--gold);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 800;
    font-family: bakh, sans-serif;
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}
.btn-primary:hover {
    background: #C49010;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212,160,23,0.4);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.success { background: #52C41A; box-shadow: 0 6px 24px rgba(82,196,26,0.35); }

.btn-ghost {
    width: 100%;
    height: 48px;
    background: transparent;
    border: 1.5px solid #E5E5EA;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    font-family: bakh, sans-serif;
    color: var(--text-mid);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--text-dark); background: var(--gold-pale); }

/* ── Spinner ── */
.spinner {
    width: 16px; height: 16px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ── */
.step-divider {
    height: 1px;
    background: #F0F0F0;
    margin: 20px 0;
}

/* ── Progress dots ── */
.progress-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
}
.p-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #E5E5EA;
    transition: all 0.3s;
}
.p-dot.done { background: var(--gold); width: 18px; border-radius: 3px; }
.p-dot.active { background: var(--gold); opacity: 0.5; }

/* ── Welcome icon ── */
.welcome-emoji {
    font-size: 3rem;
    line-height: 1;
    display: block;
    margin-bottom: 12px;
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounceIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ── Footer note ── */
.auth-note {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-soft);
    margin-top: 16px;
    line-height: 1.8;
}

/* ── Desktop enhancements ── */
@media (min-width: 500px) {
    body {
        padding: 40px 20px;
    }
    .auth-wrap {
        min-height: auto;
        padding: 0;
    }
    .auth-topbar {
        padding-top: 0;
    }
    .auth-card {
        padding: 32px 36px;
    }
    .auth-hero {
        padding: 20px 0 28px;
    }
}
