:root {
    --bg-color: #f4f6f8;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #ff7a00;
    --accent-hover: #e06c00;
    --accent-glow: rgba(255, 122, 0, 0.35);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
}

.container {
    max-width: 900px;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 4rem;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0,0,0,0.02);
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header & Logo */
.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
}

.logo-text {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: #000000;
}

.highlight {
    color: var(--accent-color);
}

/* Content */
.badge {
    display: inline-block;
    background: rgba(255, 122, 0, 0.1);
    color: var(--accent-color);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
}

.content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.content p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .container {
        padding: 2.5rem 1.5rem;
        border-radius: 16px;
    }

    .logo-text {
        font-size: 2.5rem;
    }

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

/* ============================================ */
/*  MODAL POPUP — PREMIUM DARK DESIGN          */
/* ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 1rem;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Card */
.modal-card {
    position: relative;
    background: linear-gradient(165deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    border: 1px solid rgba(255, 122, 0, 0.15);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    transform: translateY(30px) scale(0.92);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.modal-overlay.show .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Glow effect */
.modal-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.6;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.15); }
}

/* Close button */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 2;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: rotate(90deg);
}

/* Animated Icon */
.modal-icon-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 122, 0, 0.25);
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.4; }
}

.modal-icon {
    width: 36px;
    height: 36px;
    animation: bounceIcon 2s ease-in-out infinite;
}

@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Amount badge */
.modal-amount {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-color), #ffb347);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    padding: 0.3rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* Typography */
.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.5rem;
}

.modal-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.modal-desc strong {
    color: var(--accent-color);
    font-weight: 700;
}

/* Input group */
.input-group {
    position: relative;
    margin-bottom: 0.8rem;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.input-group:focus-within .input-icon {
    opacity: 1;
    stroke: var(--accent-color);
}

.input-group input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 2.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-group input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 122, 0, 0.06);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.1);
}

/* Submit button */
.modal-btn {
    width: 100%;
    padding: 0.95rem;
    background: linear-gradient(135deg, var(--accent-color), #e06c00);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 20px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.modal-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.modal-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.modal-btn:active:not(:disabled) {
    transform: translateY(0);
}

.modal-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner animation */
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-loader svg {
    animation: spin 0.8s linear infinite;
}

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

/* Error message */
.form-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.6rem;
    min-height: 1.2rem;
}

/* Footer text */
.modal-footer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    margin-top: 1.2rem;
    margin-bottom: 0;
}

/* ============================================ */
/*  SUCCESS STATE                               */
/* ============================================ */

/* Animated checkmark */
.success-check-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
}

.success-check {
    width: 72px;
    height: 72px;
}

.success-check-circle {
    stroke: var(--accent-color);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-check-path {
    stroke: var(--accent-color);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes strokeCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes strokeCheck {
    to { stroke-dashoffset: 0; }
}

/* Discount code box */
.code-box {
    background: rgba(255, 122, 0, 0.08);
    border: 1.5px solid rgba(255, 122, 0, 0.25);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    position: relative;
}

.code-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
}

.code-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--accent-color), #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.code-copy {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.25s ease;
}

.code-copy:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

.code-copy.copied {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
}

/* Confetti canvas */
#confettiCanvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
    z-index: 10;
}

/* ============================================ */
/*  MODAL VIEW COMMON                           */
/* ============================================ */
.modal-view {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* ============================================ */
/*  RESPONSIVE                                  */
/* ============================================ */
@media (max-width: 480px) {
    .modal-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-amount {
        font-size: 1.4rem;
    }

    .code-value {
        font-size: 1.3rem;
    }
}
