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

:root {
    --bg-gradient-1: #0f172a;
    --bg-gradient-2: #1e1b4b;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --accent-glow: rgba(139, 92, 246, 0.3);
    --otp-bg: rgba(15, 23, 42, 0.6);
    --otp-border: rgba(139, 92, 246, 0.4);
    --otp-text: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    background-size: 200% 200%;
    animation: bgShift 15s ease infinite;
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
}

/* Background Animated Blobs */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(76,29,149,0.4) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    left: -100px;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14,165,233,0.3) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    right: -150px;
    animation-direction: alternate-reverse;
}

@keyframes bgShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Main Container - Glassmorphism */
.container {
    width: 90%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    z-index: 10;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Code Display Area */
.otp-container {
    background: var(--otp-bg);
    border: 1px solid var(--otp-border);
    padding: 1.5rem 1rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 0 0 30px var(--accent-glow);
    overflow: hidden;
}

/* Subtle inner glow for OTP box */
.otp-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.otp-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--otp-text);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

/* Subtle entrance animation when code refreshes */
.otp-code.refreshing {
    opacity: 0;
    transform: scale(0.95);
}

/* Layout for copy button & tooltips */
.copy-wrapper {
    margin-top: 1.5rem;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

/* Countdown Timer */
.timer-container {
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
}

.timer-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 600;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Loader / Skeleton State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

@media (max-width: 480px) {
    .container {
        padding: 2rem 1.5rem;
    }
    .otp-code {
        font-size: 2.25rem;
        letter-spacing: 4px;
    }
}
