/* ============================================
   AutoWebsite — Landing Page Styles
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #8b5cf6;
    --bg: #0a0a0f;
    --bg-card: rgba(17, 17, 27, 0.8);
    --border: rgba(255, 255, 255, 0.06);
    --text: #f1f1f4;
    --text-muted: #71717a;
    --error: #ef4444;
    --success: #22c55e;
    --radius: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ---- Animated background glows ---- */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -100px;
    animation: float1 12s ease-in-out infinite;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    right: -100px;
    animation: float2 15s ease-in-out infinite;
}

.bg-glow-3 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 10s ease-in-out infinite;
    opacity: 0.15;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, 40px) scale(1.1); }
    66% { transform: translate(-30px, 60px) scale(0.95); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, -30px) scale(1.05); }
    66% { transform: translate(40px, -50px) scale(1.1); }
}

@keyframes float3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* ---- Container ---- */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 630px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* ---- Card ---- */
.card {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 20px 60px -10px rgba(0, 0, 0, 0.5),
        0 0 120px -20px rgba(99, 102, 241, 0.15);
    animation: cardIn 0.6s ease-out;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Logo ---- */
.logo {
    margin-bottom: 28px;
    display: inline-block;
    animation: logoIn 0.8s ease-out 0.2s backwards;
}

@keyframes logoIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ---- Typography ---- */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ---- Code Input ---- */
.code-input-wrapper {
    margin-bottom: 24px;
}

.code-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.code-char {
    width: 44px;
    height: 56px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Inter', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    transition: all 0.2s ease;
    caret-color: var(--primary-light);
}

.code-char:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.code-char.filled {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.code-char.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.08);
    animation: shake 0.4s ease;
}

.separator {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin: 0 2px;
    user-select: none;
}

.code-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 0.05em;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---- Button ---- */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px -5px rgba(99, 102, 241, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn-primary:hover:not(:disabled) .btn-arrow {
    transform: translateX(4px);
}

/* ---- Loading state ---- */
.btn-primary.loading .btn-text,
.btn-primary.loading .btn-arrow {
    opacity: 0;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Error message ---- */
.error-message {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

.error-message.visible {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Footer ---- */
footer {
    text-align: center;
}

footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
    .card {
        padding: 36px 24px;
    }

    .code-char {
        width: 38px;
        height: 48px;
        font-size: 1.1rem;
    }

    .code-inputs {
        gap: 5px;
    }

    h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 380px) {
    .code-char {
        width: 32px;
        height: 42px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .separator {
        margin: 0;
        font-size: 1.2rem;
    }
}
