*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-1: #0f0c29;
    --bg-2: #302b63;
    --bg-3: #24243e;
    --accent: #ff6b9d;
    --accent-2: #c44fff;
    --accent-glow: rgba(255, 107, 157, 0.45);
    --text: #f8f9ff;
    --text-muted: rgba(248, 249, 255, 0.65);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --radius: 24px;
    --transition: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* Animated background blobs */
.bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 12s ease-in-out infinite;
}

.shape-1 {
    width: 420px;
    height: 420px;
    background: var(--accent);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-2);
    bottom: -5%;
    right: -5%;
    animation-delay: -4s;
}

.shape-3 {
    width: 280px;
    height: 280px;
    background: #4facfe;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -8s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Main card */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.card {
    position: relative;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 107, 157, 0.12), transparent 50%);
    pointer-events: none;
}

/* Form */
.form-view {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.form-view.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.wave {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-8deg); }
    45% { transform: rotate(14deg); }
    60% { transform: rotate(-4deg); }
    75% { transform: rotate(10deg); }
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
    margin-top: -0.5rem;
}

/* Floating label input */
.input-group {
    position: relative;
    margin-top: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 1.1rem 1.25rem;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--text);
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.input-group input::placeholder {
    color: transparent;
}

.input-group input:focus,
.input-group input:not(:placeholder-shown) {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.input-group label {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: all var(--transition);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--bg-2);
    padding: 0 0.4rem;
    border-radius: 4px;
}

/* Submit button */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 1rem 1.5rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.35);
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 157, 0.5);
}

.btn-submit:hover::before {
    transform: translateX(100%);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.btn-submit:hover .btn-icon {
    transform: translateX(4px);
}

/* Result view */
.result-view {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-view.visible {
    opacity: 1;
    transform: scale(1);
}

.result-view[hidden] {
    display: none;
}

.result-icon {
    font-size: 3.5rem;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(-20deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.result-text {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.4;
    animation: slideUp 0.5s ease 0.2s both;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.85));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-view.special .result-text {
    background: linear-gradient(135deg, #ffd700, #ff6b9d, #c44fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 0.5s ease 0.2s both, shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-back {
    margin-top: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-back:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

/* Confetti burst on special */
.result-view.special::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@media (max-width: 480px) {
    .card {
        padding: 2rem 1.5rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .result-text {
        font-size: 1.35rem;
    }
}
