:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.5);
    --timer-bg: rgba(255, 255, 255, 0.1);
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Blobs */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #7c3aed;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #2563eb;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
    animation-duration: 25s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #06b6d4;
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 22s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9) rotate(-5deg);
    }

    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
}

/* Card */
.container {
    padding: 20px;
    width: 100%;
    max-width: 400px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 40px;
}

/* TOTP Display */
.totp-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.code-wrapper {
    position: relative;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.code-wrapper:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.code-wrapper:active {
    transform: scale(0.98);
}

.otp-code {
    font-family: var(--font-mono);
    font-size: 3rem;
    letter-spacing: 4px;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
    display: block;
    min-width: 220px;
}

.copy-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.copy-tooltip.show {
    top: -40px;
    opacity: 1;
}

/* Timer */
.timer-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.timer-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-bg {
    fill: none;
    stroke: var(--timer-bg);
    stroke-width: 6;
}

.timer-progress {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    /* 2 * PI * 45 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Status */
.status {
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 480px) {
    .otp-code {
        font-size: 2.5rem;
    }
}

/* Digit Animations */
@keyframes slideInDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.digit {
    display: inline-block;
    animation-duration: 0.5s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    /* bouncy */
}

.digit.down {
    animation-name: slideInDown;
}

.digit.up {
    animation-name: slideInUp;
}