/* ============================================================
   CEPINO - Gamified Lead Magnet Styles
   Fonts: Playfair Display (headings) + Montserrat (body)
   Brand: Burgundy / Wine Red / Gold
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --burgundy: #862633;
    --burgundy-light: #A03040;
    --burgundy-dark: #5C1A22;
    --burgundy-deep: #3D0F16;
    --gold: #D4AF37;
    --gold-light: #E8C84A;
    --cream: #FDF8F5;
    --slate: #1E1A1B;
    --bg: #1A0A0E;
    --bg-card: #FFFFFF;
    --text: #1E1A1B;
    --text-secondary: #6B5A5E;
    --text-light: #FFFFFF;
    --radius: 24px;
    --radius-sm: 14px;
    --shadow: 0 25px 60px rgba(26, 10, 14, 0.5);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, sans-serif;
}

html, body {
    height: 100%;
    height: 100dvh;
    font-family: var(--font-body);
    background: linear-gradient(145deg, var(--bg) 0%, #2D0F18 40%, #1A0A0E 100%);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* ---- Confetti Canvas ---- */
#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* ---- App Container ---- */
#app {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* ---- Steps ---- */
.step {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.step.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.step.exit {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
}

/* ---- Card ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
}

.card h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--slate);
    margin-bottom: 10px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* ---- Logo ---- */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.logo-img {
    height: 60px;
    width: auto;
}

/* ---- Welcome ---- */
.welcome-title {
    margin-bottom: 12px !important;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
    -webkit-appearance: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-light) 100%);
    color: var(--text-light);
    padding: 16px 40px;
    width: 100%;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(134, 38, 51, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(134, 38, 51, 0.5);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ---- Qualify ---- */
.qualify-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 22px;
}

.qualify-card {
    background: var(--cream);
    border: 2px solid #E8D5D8;
    border-radius: var(--radius-sm);
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-family: var(--font-body);
    -webkit-appearance: none;
}

.qualify-card:hover {
    border-color: var(--burgundy);
    background: #FFF0F2;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(134, 38, 51, 0.12);
}

.qualify-card:active {
    transform: scale(0.98);
}

.qualify-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.qualify-card h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--burgundy);
    margin-bottom: 6px;
}

.qualify-card p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Wheel ---- */
.wheel-card {
    padding: 28px 20px;
}

.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

.wheel-container canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    filter: drop-shadow(0 8px 30px rgba(134, 38, 51, 0.25));
    cursor: grab;
}

.wheel-container canvas:active {
    cursor: grabbing;
}

.wheel-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 28px solid var(--gold);
    z-index: 10;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.wheel-pointer::after {
    content: '';
    position: absolute;
    top: -32px;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--gold-light);
    border-radius: 50%;
}

.wheel-hint {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 400;
    margin-top: 8px;
    opacity: 0.7;
}

.btn-spin {
    margin-top: 14px;
    animation: pulseGlow 2s ease-in-out infinite;
}

.btn-spin:disabled {
    animation: none;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(134, 38, 51, 0.35); }
    50% { box-shadow: 0 4px 35px rgba(134, 38, 51, 0.65); }
}

/* ---- Result ---- */
.result-card {
    overflow: visible;
}

.result-celebration {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: bounceIn 0.6s ease;
}

.result-prize {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 8px;
}

.result-months {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 4.5rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--slate);
}

.result-detail {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 28px;
    line-height: 1.5;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Form ---- */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    text-align: left;
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E8D5D8;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--text);
    background: var(--cream);
    transition: border-color 0.2s ease, background 0.2s ease,
        box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: var(--burgundy);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(134, 38, 51, 0.1);
}

.form-group input::placeholder {
    color: #A0909A;
    font-weight: 400;
}

.pro-fields {
    border-top: 1px solid #E8D5D8;
    padding-top: 14px;
    margin-top: 4px;
}

.hidden {
    display: none !important;
}

#lead-form .btn,
#bonus-form .btn {
    margin-top: 10px;
}

/* ---- Bonus ---- */
.bonus-subtitle {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 400;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ---- Thanks ---- */
.thanks-summary {
    margin: 16px 0;
}

.thanks-email {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 400;
    margin: 20px 0;
    line-height: 1.6;
}

.thanks-email strong {
    color: var(--burgundy);
    font-weight: 600;
}

.thanks-footer {
    border-top: 1px solid #E8D5D8;
    padding-top: 18px;
    margin-top: 18px;
}

.thanks-footer p {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.thanks-footer strong {
    color: var(--burgundy);
    font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---- Large phones (375–420px) ---- */
@media (max-width: 420px) {
    .card {
        padding: 28px 20px;
        border-radius: 20px;
        max-width: 100%;
    }

    .card h2 {
        font-size: 1.35rem;
    }

    .logo-img {
        height: 48px;
    }

    .welcome-subtitle {
        font-size: 0.88rem;
    }

    .wheel-container {
        width: 260px;
        height: 260px;
    }

    .result-months {
        font-size: 3.8rem;
    }

    .btn-primary {
        padding: 14px 28px;
        font-size: 0.92rem;
    }

    .qualify-card {
        padding: 18px 16px;
    }

    .qualify-card h3 {
        font-size: 1.05rem;
    }
}

/* ---- Small phones (320–374px) ---- */
@media (max-width: 374px) {
    .step {
        padding: 12px;
    }

    .card {
        padding: 22px 16px;
        border-radius: 18px;
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .logo-img {
        height: 40px;
    }

    .logo-container {
        margin-bottom: 18px;
    }

    .welcome-subtitle {
        font-size: 0.82rem;
        margin-bottom: 20px;
    }

    .wheel-container {
        width: 220px;
        height: 220px;
        margin: 14px auto;
    }

    .wheel-pointer {
        border-left-width: 12px;
        border-right-width: 12px;
        border-top-width: 22px;
        top: -14px;
    }

    .wheel-pointer::after {
        width: 12px;
        height: 12px;
        top: -26px;
        left: -6px;
    }

    .result-months {
        font-size: 3rem;
    }

    .result-label {
        font-size: 1.1rem;
    }

    .result-celebration {
        font-size: 2.5rem;
    }

    .qualify-icon {
        font-size: 1.8rem;
        margin-bottom: 6px;
    }

    .qualify-card p {
        font-size: 0.78rem;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 0.88rem;
    }

    .form-group label {
        font-size: 0.72rem;
    }

    .btn-primary {
        padding: 12px 24px;
        font-size: 0.88rem;
    }
}

/* ---- Short viewports (landscape phones, small screens) ---- */
@media (max-height: 680px) {
    .step {
        align-items: flex-start;
        padding-top: 12px;
    }

    .card {
        padding: 20px 18px;
    }

    .card h2 {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }

    .logo-container {
        margin-bottom: 16px;
    }

    .logo-img {
        height: 42px;
    }

    .welcome-subtitle {
        font-size: 0.85rem;
        margin-bottom: 18px;
    }

    .wheel-container {
        width: 200px;
        height: 200px;
        margin: 10px auto;
    }

    .wheel-hint {
        font-size: 0.72rem;
        margin-top: 4px;
    }

    .btn-spin {
        margin-top: 8px;
    }

    .result-celebration {
        font-size: 2.2rem;
        margin-bottom: 4px;
    }

    .result-months {
        font-size: 3rem;
    }

    .result-prize {
        margin: 12px 0 6px;
    }

    .result-detail {
        margin-bottom: 16px;
        font-size: 0.88rem;
    }

    .qualify-options {
        gap: 10px;
        margin-top: 14px;
    }

    .qualify-card {
        padding: 14px 14px;
    }

    .qualify-icon {
        font-size: 1.6rem;
        margin-bottom: 4px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group input {
        padding: 11px 12px;
    }

    .bonus-subtitle {
        font-size: 0.85rem;
        margin-bottom: 14px;
    }

    .thanks-summary {
        margin: 10px 0;
    }

    .thanks-email {
        margin: 12px 0;
        font-size: 0.82rem;
    }

    .thanks-footer {
        padding-top: 12px;
        margin-top: 12px;
    }
}

/* ---- Very short viewports (landscape phones) ---- */
@media (max-height: 550px) {
    .step {
        padding-top: 8px;
    }

    .card {
        padding: 16px 14px;
    }

    .card h2 {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }

    .logo-container {
        margin-bottom: 10px;
    }

    .logo-img {
        height: 32px;
    }

    .welcome-subtitle {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .wheel-container {
        width: 170px;
        height: 170px;
        margin: 8px auto;
    }

    .result-celebration {
        font-size: 1.8rem;
    }

    .result-months {
        font-size: 2.5rem;
    }

    .result-label {
        font-size: 1rem;
    }

    .btn-primary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .qualify-options {
        flex-direction: row;
        gap: 10px;
    }

    .qualify-card {
        flex: 1;
        padding: 12px 10px;
    }

    .qualify-icon {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    .qualify-card h3 {
        font-size: 0.92rem;
    }

    .qualify-card p {
        font-size: 0.72rem;
    }

    .form-group {
        margin-bottom: 8px;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .form-group label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
}

/* ---- Tablets & wider screens ---- */
@media (min-width: 768px) {
    .card {
        max-width: 440px;
        padding: 48px 40px;
    }

    .card h2 {
        font-size: 1.8rem;
    }

    .logo-img {
        height: 68px;
    }

    .welcome-subtitle {
        font-size: 1.05rem;
    }

    .wheel-container {
        width: 340px;
        height: 340px;
    }

    .result-months {
        font-size: 5rem;
    }

    .result-label {
        font-size: 1.6rem;
    }

    .qualify-options {
        flex-direction: row;
        gap: 16px;
    }

    .qualify-card {
        flex: 1;
        padding: 28px 20px;
    }
}

/* ---- Desktop ---- */
@media (min-width: 1024px) {
    .card {
        max-width: 480px;
        padding: 52px 44px;
        border-radius: 28px;
    }

    .card h2 {
        font-size: 1.9rem;
    }

    .wheel-container {
        width: 360px;
        height: 360px;
    }
}

/* ---- Utilities ---- */
.loading .btn-primary::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.6s linear infinite;
}

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