/**
 * DiraCoin - Design Fintech/Crypto Moderne
 * Pages d'authentification - Mobile First
 */

/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    --primary: #00d4aa;
    --primary-dark: #00b894;
    --primary-glow: rgba(0, 212, 170, 0.3);
    --secondary: #6c5ce7;
    --accent: #fd79a8;
    --bg-dark: #0a0e17;
    --bg-card: #131a2b;
    --bg-input: #1a2332;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #8b95a5;
    --text-muted: #5a6270;
    --success: #00d4aa;
    --error: #ff6b6b;
    --warning: #ffc107;
    --gradient-primary: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    --gradient-bg: linear-gradient(180deg, #0a0e17 0%, #131a2b 100%);
    --shadow-glow: 0 0 30px rgba(0, 212, 170, 0.2);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LAYOUT - AUTH PAGES
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Background Effects */
.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(0, 212, 170, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(108, 92, 231, 0.06) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, -2%) rotate(1deg); }
}

/* Floating Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    pointer-events: none;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: orbFloat1 15s ease-in-out infinite;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation: orbFloat2 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* ============================================
   AUTH CARD
   ============================================ */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
}

/* Glassmorphism effect */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* ============================================
   LOGO & HEADER
   ============================================ */
.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo img {
    height: 50px;
    margin-bottom: 15px;
}

.auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Input with icon */
.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 48px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.input-group .form-input:focus + .input-icon,
.input-group .form-input:not(:placeholder-shown) + .input-icon {
    color: var(--primary);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: var(--gradient-primary);
    color: #000;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 212, 170, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--warning);
}

/* ============================================
   LINKS & TEXT
   ============================================ */
.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.auth-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 15px;
}

/* ============================================
   OTP INPUT
   ============================================ */
.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 25px 0;
}

.otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.3s;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ============================================
   CHECKBOX
   ============================================ */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    margin-top: 2px;
}

.checkbox-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        border-radius: var(--radius-md);
    }
    
    .auth-logo h1 {
        font-size: 1.5rem;
    }
    
    .otp-input {
        width: 45px;
        height: 55px;
        font-size: 1.3rem;
    }
}

@media (min-width: 768px) {
    .auth-card {
        padding: 50px 40px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
