/* ========================================
   NINTENDO eSHOP GIFT CARD — STYLE SHEET
   ======================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&family=Space+Grotesk:wght@400;500;700&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red:        #e60012;
    --red-dark:   #b0000e;
    --red-glow:   rgba(230, 0, 18, 0.35);
    --bg:         #0c0d11;
    --surface:    #13151c;
    --surface2:   #1b1e28;
    --border:     rgba(255,255,255,0.07);
    --text:       #f0f0f5;
    --muted:      #7a7f96;
    --green:      #22c55e;
    --yellow:     #facc15;
    --code-font:  'Space Grotesk', monospace;
    --body-font:  'Outfit', sans-serif;
    --radius:     16px;
    --radius-sm:  10px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--body-font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── BACKGROUND GLOWS ── */
.glow-bg {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}
.glow-red {
    width: 600px; height: 600px;
    background: var(--red);
    top: -200px; left: -150px;
    animation: floatGlow 8s ease-in-out infinite alternate;
}
.glow-blue {
    width: 500px; height: 500px;
    background: #1a00ff;
    bottom: -150px; right: -100px;
    animation: floatGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, 30px) scale(1.1); }
}

/* ── APP CONTAINER ── */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ── */
.header {
    padding: 28px 0 20px;
    display: flex;
    justify-content: center;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 24px;
    backdrop-filter: blur(12px);
}

.nintendo-logo {
    width: 120px;
    height: auto;
    color: var(--red);
    filter: drop-shadow(0 0 8px var(--red-glow));
}

.eshop-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red);
    background: rgba(230, 0, 18, 0.12);
    border: 1px solid rgba(230, 0, 18, 0.3);
    padding: 4px 10px;
    border-radius: 50px;
}

/* ── MAIN CONTENT ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* ── CARD STEPS ── */
.card-step {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    animation: fadeSlideIn 0.5s ease forwards;
}

.card-step.active {
    display: flex;
}

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

/* ── TYPOGRAPHY ── */
.title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.highlight {
    color: var(--red);
    text-shadow: 0 0 30px var(--red-glow);
}

.subtitle {
    font-size: 1rem;
    color: var(--muted);
    text-align: center;
    max-width: 480px;
    line-height: 1.6;
}

/* ── NINTENDO GIFT CARD ── */
.card-preview-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.nintendo-gift-card {
    width: 340px;
    height: 210px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1a0006 0%, #3b0010 40%, #1a0006 100%);
    border: 1px solid rgba(230, 0, 18, 0.3);
    box-shadow:
        0 0 40px rgba(230, 0, 18, 0.2),
        0 25px 60px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 22px;
    position: relative;
    overflow: hidden;
    animation: cardFloat 4s ease-in-out infinite alternate;
    transition: box-shadow 0.4s;
}

.card-preview-wrapper:not(.processing):hover .nintendo-gift-card {
    box-shadow:
        0 0 60px rgba(230, 0, 18, 0.4),
        0 35px 70px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transform: rotateY(-3deg) rotateX(3deg);
}

@keyframes cardFloat {
    from { transform: translateY(0) rotateX(2deg); }
    to   { transform: translateY(-10px) rotateX(-2deg); }
}

.card-glass-glow {
    position: absolute;
    top: -40%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(230,0,18,0.25), transparent 70%);
    pointer-events: none;
}

.card-glass-glow.scan-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, transparent, rgba(230,0,18,0.8), transparent);
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    from { top: 0%; }
    to   { top: 100%; }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-brand {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
}

.card-chip {
    width: 30px; height: 22px;
    background: linear-gradient(135deg, #d4aa70, #f0d080, #c9922c);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.card-logo-glow {
    position: absolute;
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(230,0,18,0.3), transparent 70%);
    pointer-events: none;
}

.nintendo-word {
    font-family: var(--body-font);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 0 20px var(--red-glow), 0 2px 4px rgba(0,0,0,0.5);
}

.card-eshop-text {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--red);
    text-shadow: 0 0 16px var(--red-glow);
}

.card-region {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}

/* Card Processing State */
.nintendo-gift-card.processing {
    animation: cardPulse 1.5s ease-in-out infinite;
}

@keyframes cardPulse {
    0%,100% { box-shadow: 0 0 30px rgba(230,0,18,0.2), 0 20px 50px rgba(0,0,0,0.5); }
    50%      { box-shadow: 0 0 60px rgba(230,0,18,0.5), 0 20px 50px rgba(0,0,0,0.5); }
}

/* Card Success State */
.nintendo-gift-card.success {
    background: linear-gradient(135deg, #001a05 0%, #003510 40%, #001a05 100%);
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.2), 0 25px 60px rgba(0,0,0,0.6);
    animation: cardFloat 4s ease-in-out infinite alternate;
}

/* Card Status Badge */
.card-status-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.4);
    padding: 3px 8px;
    border-radius: 50px;
    background: rgba(34, 197, 94, 0.1);
}

/* ── CODE SCRAMBLER BOX ── */
.code-scrambler-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 18px;
    width: 100%;
}

.code-scrambler-label {
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
}

.code-font {
    font-family: var(--code-font);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #fff;
}

.code-scrambler-box.completed .code-font {
    color: #fff;
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.loading-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--red);
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
    0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
    40%          { transform: scale(1); opacity: 1; }
}

/* Progress Percent */
.progress-percent {
    font-family: var(--code-font);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--red);
}

/* ── PROGRESS BAR ── */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 100px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--red-dark), var(--red), #ff5c6e);
    border-radius: 100px;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px var(--red-glow);
}

/* ── CONSOLE BOX ── */
.console-box {
    width: 100%;
    background: rgba(5, 5, 10, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.console-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}

.console-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}

.console-dot.red    { background: #ff5f57; }
.console-dot.yellow { background: #ffbd2e; }
.console-dot.green  { background: #28c840; }

.console-title {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    margin-left: 4px;
}

.console-logs {
    padding: 14px 16px;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.console-logs::-webkit-scrollbar { width: 4px; }
.console-logs::-webkit-scrollbar-track { background: transparent; }
.console-logs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.log-line {
    font-family: var(--code-font);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text);
    opacity: 0;
    animation: logFadeIn 0.3s ease forwards;
}

.log-line.text-muted  { color: var(--muted); opacity: 1; }
.log-line.text-green  { color: var(--green); }
.log-line.text-yellow { color: var(--yellow); }
.log-line.text-red    { color: var(--red); }

@keyframes logFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── EMAIL FORM ── */
.form-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.03em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 18px; height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 18px 16px 48px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--body-font);
    font-size: 0.95rem;
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
}

.input-wrapper input::placeholder { color: var(--muted); }

.input-wrapper input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.15);
}

.input-wrapper input.input-error {
    border-color: #ff5f57;
    box-shadow: 0 0 0 3px rgba(255, 95, 87, 0.15);
}

.error-msg {
    font-size: 0.8rem;
    color: #ff5f57;
    display: none;
    align-items: center;
    gap: 5px;
}

.error-msg.show { display: flex; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

.btn:hover::before { opacity: 1; }

.btn-primary {
    background: linear-gradient(135deg, var(--red-dark) 0%, var(--red) 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(230, 0, 18, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(230, 0, 18, 0.55);
}

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

.btn-glow {
    animation: btnGlow 2.5s ease-in-out infinite alternate;
}

@keyframes btnGlow {
    from { box-shadow: 0 4px 20px rgba(230, 0, 18, 0.35); }
    to   { box-shadow: 0 6px 35px rgba(230, 0, 18, 0.65), 0 0 60px rgba(230, 0, 18, 0.2); }
}

.btn-large { padding: 20px 32px; font-size: 1.1rem; }

.btn-arrow, .btn-lock-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    transition: transform 0.25s;
}

.btn:hover .btn-arrow  { transform: translateX(4px); }
.btn:hover .btn-lock-icon { transform: scale(1.15); }

/* ── SUCCESS BADGE ── */
.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 10px 20px;
    border-radius: 50px;
}

.success-badge svg {
    width: 16px; height: 16px;
    stroke: var(--green);
}

/* ── UNLOCK STEP ── */
.unlock-desc {
    text-align: center;
    color: var(--muted);
    line-height: 1.7;
    max-width: 500px;
}

.unlock-desc strong { color: var(--text); }

/* Final code display */
.final-code-display {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    font-size: 1rem;
}

.masked-digits {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--red);
    animation: pulseMask 2s ease-in-out infinite;
}

.stars { letter-spacing: 0.15em; }

@keyframes pulseMask {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.padlock-icon {
    width: 14px; height: 14px;
    stroke: var(--red);
}

/* ── EMAIL NOTICE BOX ── */
.email-notice-box {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    backdrop-filter: blur(10px);
}

.notice-icon {
    width: 22px; height: 22px;
    color: var(--muted);
    flex-shrink: 0;
}

.email-notice-box p {
    font-size: 0.87rem;
    color: var(--muted);
    line-height: 1.6;
}

.email-notice-box p strong { color: rgba(255,255,255,0.7); }

.user-email-text {
    color: var(--red) !important;
    font-weight: 700;
}

/* ── SPONSOR BOX ── */
.sponsor-box {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
}

.task-instructions {
    font-size: 0.92rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
}

.task-instructions strong { color: var(--text); }

/* Realtime Status */
.realtime-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--muted);
}

.status-pulse-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--yellow);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.5); }
    50%      { box-shadow: 0 0 0 6px rgba(250, 204, 21, 0); }
}

/* ── FOOTER ── */
.footer {
    text-align: center;
    padding: 40px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.2);
}

.disclaimer {
    font-size: 0.7rem !important;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
    color: rgba(255,255,255,0.15) !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .nintendo-gift-card { width: 300px; height: 185px; }
    .nintendo-word { font-size: 1.6rem; }
    .title { font-size: 1.5rem; }
    .btn { padding: 15px 24px; }
    .btn-large { padding: 17px 24px; font-size: 1rem; }
    .final-code-display { font-size: 0.9rem; }
}
