/* Base Styles - Friendly & Colorful Theme */

/* Import Google Font for friendlier typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Primary palette - warm gold */
    --primary: #E6A800;
    --primary-light: #FFD54F;
    --primary-dark: #C49000;
    --primary-bg: #FFF8E1;

    /* Secondary colors */
    --success: #4CAF50;
    --success-light: #E8F5E9;
    --error: #EF5350;
    --error-light: #FFEBEE;

    /* Neutrals */
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-muted: #A0AEC0;
    --bg-page: linear-gradient(135deg, #D9D9D9 0%, #D1CECB 100%);
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #EDF2F7;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --shadow-glow: 0 0 20px rgba(230, 168, 0, 0.3);

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 20px;
    padding-bottom: 70px; /* clearance for fixed progress bar */
    height: 100vh; /* fallback */
    height: 100dvh; /* dynamic viewport height for mobile browsers */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease-out;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1 {
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 8px 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

h3 {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    margin: 0;
}

/* Buttons */
.submit-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    margin-top: 20px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 14px rgba(230, 168, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 168, 0, 0.5);
}

.submit-btn:hover::before {
    left: 100%;
}

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

.submit-btn:disabled {
    background: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.back-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-normal);
}

.back-btn:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    background: var(--bg-card);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

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

select:disabled {
    background-color: var(--border-light);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border);
}

/* Messages */
.loading-message {
    color: var(--primary-dark);
    font-weight: 500;
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.error-message {
    color: var(--error);
    font-weight: 500;
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--error-light);
    border-radius: var(--radius-md);
    border: none;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Links */
.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Mobile Responsive */
@media (max-width: 600px) {
    body {
        padding: 12px;
        padding-bottom: 60px;
    }

    .container {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
    }

    h1 {
        font-size: 1.5rem;
    }

    .submit-btn, .back-btn {
        width: 100%;
        margin: 8px 0;
        padding: 16px;
    }
}

/* Short viewport adjustments */
@media (max-height: 600px) {
    .container {
        padding: 16px;
    }

    h1 {
        font-size: 1.35rem;
        margin-bottom: 4px !important;
    }

    .subtitle {
        display: none;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100% - 40px);
    width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-hide {
    opacity: 0;
    transform: translateY(-10px);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.toast-error .toast-icon {
    background: var(--error-light);
    color: var(--error);
}

.toast-success .toast-icon {
    background: var(--success-light);
    color: var(--success);
}

.toast-info .toast-icon {
    background: #E3F2FD;
    color: #1976D2;
}

.toast-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

@media (max-width: 480px) {
    #toast-container {
        top: 12px;
        width: calc(100% - 24px);
    }

    .toast {
        padding: 12px 16px;
    }
}
