/* ============================================
   SPLASH SCREEN — POS Terminal + Card Swipe + Receipt
   Colors aligned to site: black (#000) / gold (#ffb800)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700&family=JetBrains+Mono:wght@400;500;700&display=swap');

body.splash-active {
    overflow: hidden;
}

/* ===== OVERLAY ===== */
#splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Subtle ambient gold glow */
#splash-overlay::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,184,0,0.04) 0%, transparent 70%);
    pointer-events: none;
}
#splash-overlay::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,184,0,0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* ===== SPLASH STAGE ===== */
.splash-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 700px;
    min-height: 420px;
}

/* ===== POS TERMINAL DEVICE ===== */
.pos-terminal {
    position: relative;
    width: 320px;
    background: #111111;
    border-radius: 20px;
    border: 2px solid #222222;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.8),
        0 2px 8px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.04);
    overflow: visible;
    z-index: 2;

    /* Entry */
    opacity: 0;
    transform: translateY(30px);
    animation: terminalEnter 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes terminalEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Terminal top bezel with brand */
.pos-top-bezel {
    padding: 16px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1a1a1a;
}

.pos-brand {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #444444;
    font-weight: 500;
}

.pos-led-row {
    display: flex;
    gap: 6px;
}

.pos-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1a1a1a;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.pos-led.power {
    background: #ffb800;
    box-shadow: 0 0 6px rgba(255,184,0,0.3);
}

.pos-led.status-active {
    background: #ffb800;
    box-shadow: 0 0 8px rgba(255,184,0,0.4);
    animation: ledPulse 1.2s ease infinite;
}

.pos-led.status-approved {
    background: #34d399;
    box-shadow: 0 0 10px rgba(52,211,153,0.5);
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== TERMINAL SCREEN ===== */
.pos-screen {
    margin: 12px 16px;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid #1a1a1a;
    padding: 16px;
    min-height: 100px;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    overflow: hidden;
}

/* Scanline effect on screen */
.pos-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.008) 2px,
        rgba(255,255,255,0.008) 4px
    );
    pointer-events: none;
}

.screen-line {
    font-size: 0.65rem;
    color: #ffb800;
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    letter-spacing: 0.5px;
}

.screen-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.screen-line.dim {
    color: #666666;
}

.screen-line.bright {
    color: #ffffff;
    font-weight: 700;
}

.screen-line.gold {
    color: #ffb800;
    font-weight: 700;
}

.screen-line.success {
    color: #34d399;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-align: center;
    margin-top: 8px;
}

/* Blinking cursor on screen */
.screen-cursor {
    display: inline-block;
    width: 7px;
    height: 12px;
    background: #ffb800;
    margin-left: 2px;
    vertical-align: middle;
    animation: cursorBlink 0.8s step-end infinite;
}

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

/* Progress bar on screen */
.screen-progress {
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen-progress.visible {
    opacity: 1;
}

.screen-progress-bar {
    width: 100%;
    height: 3px;
    background: #1a1a1a;
    border-radius: 2px;
    overflow: hidden;
}

.screen-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffb800, #ffcc44);
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* ===== TAP-TO-PAY ZONE ===== */
.pos-tap-zone {
    position: relative;
    height: 48px;
    margin: 8px 16px 4px;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid #1a1a1a;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pos-tap-zone.active {
    border-color: #ffb800;
    box-shadow: 0 0 12px rgba(255,184,0,0.15);
}

.pos-tap-zone.success {
    border-color: #34d399;
    box-shadow: 0 0 16px rgba(52,211,153,0.2);
}

/* NFC contactless payment icon (SVG) */
.nfc-icon {
    width: 20px;
    height: 20px;
}

.nfc-dot {
    fill: #333333;
    transition: fill 0.3s ease;
}

.nfc-arc {
    stroke: #333333;
    transition: stroke 0.3s ease, opacity 0.3s ease;
}

.pos-tap-zone.active .nfc-dot {
    fill: #ffb800;
}

.pos-tap-zone.active .nfc-arc {
    stroke: #ffb800;
    animation: nfcPulse 1s ease infinite;
}

.pos-tap-zone.active .nfc-arc-2 { animation-delay: 0.1s; }
.pos-tap-zone.active .nfc-arc-3 { animation-delay: 0.2s; }

.pos-tap-zone.success .nfc-dot {
    fill: #34d399;
}

.pos-tap-zone.success .nfc-arc {
    stroke: #34d399;
    animation: none;
}

@keyframes nfcPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pos-tap-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.45rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #333333;
    transition: color 0.3s ease;
}

.pos-tap-zone.active .pos-tap-label {
    color: #ffb800;
}

.pos-tap-zone.success .pos-tap-label {
    color: #34d399;
}

/* ===== BUSINESS CARD (tap to pay) ===== */
.swipe-card {
    position: absolute;
    width: 260px;
    height: 150px;
    border-radius: 8px;
    background: #111111;
    border: 1px solid #222222;
    box-shadow:
        0 4px 20px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.03);
    font-family: 'DM Sans', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 16px 12px 18px;
    z-index: 10;
    overflow: hidden;

    /* Start position: above the terminal, centered, invisible */
    left: 50%;
    top: -180px;
    transform: translateX(-50%);
    opacity: 0;
}

/* Gold left accent */
.swipe-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #ffb800 0%, #cc8500 100%);
}

/* Subtle grid */
.swipe-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
}

/* Card floats down into view above terminal */
.swipe-card.animate-hover {
    animation: cardHoverIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardHoverIn {
    0% {
        top: -180px;
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        top: -20px;
        opacity: 1;
    }
}

/* Card lowers gently to tap the NFC zone */
.swipe-card.animate-tap {
    animation: cardTapDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardTapDown {
    0% {
        top: -20px;
    }
    70% {
        top: 6px;
    }
    100% {
        top: 0px;
    }
}

/* Gold pulse ripple on tap contact */
.swipe-card.tap-contact::after {
    background-image: none !important;
    background: radial-gradient(circle, rgba(255,184,0,0.3) 0%, transparent 70%) !important;
    animation: tapRipple 0.6s ease-out forwards;
}

@keyframes tapRipple {
    0% { opacity: 1; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(1.6); }
}

/* Card lifts away and fades out */
.swipe-card.animate-lift {
    animation: cardLiftAway 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardLiftAway {
    0% {
        top: 0px;
        opacity: 1;
    }
    100% {
        top: -120px;
        opacity: 0;
    }
}

.card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 0.5rem;
    font-weight: 500;
    color: #ffb800;
    margin-top: 4px;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.card-tagline {
    font-size: 0.42rem;
    color: #666666;
    margin-top: 2px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

.card-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-contact-line {
    font-size: 0.4rem;
    color: #999999;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-contact-line .ci {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.36rem;
    color: #ffb800;
    width: 12px;
    text-align: center;
}

.card-contact-line.card-web {
    font-weight: 700;
    color: #ffffff;
}

.card-chip {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(135deg, #ffb800 0%, #cc8500 50%, #ffcc44 100%);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
}

/* Chip contact lines */
.card-chip::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 3px;
    right: 3px;
    height: 1px;
    background: rgba(0,0,0,0.15);
    box-shadow: 0 4px 0 rgba(0,0,0,0.15), 0 8px 0 rgba(0,0,0,0.15);
}

.card-chip::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    width: 1px;
    height: 14px;
    background: rgba(0,0,0,0.1);
}


/* ===== RECEIPT ===== */
.pos-receipt-area {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.pos-receipt {
    background: #f5f0e8;
    margin: 0 30px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: none;
    position: relative;
    border-radius: 0 0 2px 2px;
    /* Torn paper top edge */
    mask-image: linear-gradient(to bottom, transparent 0px, black 3px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 3px);
}

.pos-receipt.printing {
    animation: receiptPrint 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes receiptPrint {
    0% {
        max-height: 0;
        padding: 0 14px;
    }
    100% {
        max-height: 400px;
        padding: 12px 14px 16px;
    }
}

/* Torn bottom edge */
.pos-receipt::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(135deg, #f5f0e8 33.33%, transparent 33.33%) 0 0,
                linear-gradient(225deg, #f5f0e8 33.33%, transparent 33.33%) 0 0;
    background-size: 6px 6px;
    background-position: bottom;
}

.receipt-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: #333333;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}

.receipt-line.center {
    text-align: center;
}

.receipt-line.bold {
    font-weight: 700;
    color: #000000;
}

.receipt-line.big {
    font-size: 0.7rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: 1px;
}

.receipt-line.gold-text {
    color: #996b00;
    font-weight: 700;
}

.receipt-divider {
    border: none;
    border-top: 1px dashed #bbbbbb;
    margin: 6px 0;
}

.receipt-line.approved-stamp {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a7a3a;
    letter-spacing: 4px;
    text-align: center;
    margin-top: 6px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.receipt-line.approved-stamp.visible {
    opacity: 1;
    transform: scale(1);
}


/* ===== TERMINAL BOTTOM ===== */
.pos-bottom-bezel {
    padding: 14px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Decorative keypad dots */
.pos-keypad-dots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.pos-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid #222222;
}

.pos-dot.gold {
    background: #ffb800;
    border-color: #cc8500;
    box-shadow: 0 0 4px rgba(255,184,0,0.2);
}


/* ===== SKIP BUTTON ===== */
.splash-skip {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 10000;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #444444;
    background: none;
    border: 1px solid #222222;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s;
    opacity: 0;
    animation: fadeIn 0.5s ease 1s forwards;
}

.splash-skip:hover {
    color: #ffb800;
    border-color: #ffb800;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ===== GOLD FLASH TRANSITION ===== */
.splash-flash {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #ffb800;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.splash-flash.active {
    animation: goldFlash 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes goldFlash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 500px) {
    .pos-terminal {
        width: 280px;
    }

    .swipe-card {
        width: 220px;
        height: 130px;
        padding: 12px 14px 10px 16px;
    }

    .card-name { font-size: 0.75rem; }
    .card-title { font-size: 0.44rem; }
    .card-contact-line { font-size: 0.36rem; }

    .pos-receipt {
        margin: 0 24px;
    }

    .pos-tap-zone {
        height: 40px;
        margin: 6px 16px 4px;
    }

    .splash-skip {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 380px) {
    .pos-terminal {
        width: 260px;
    }
    .swipe-card {
        width: 200px;
        height: 120px;
    }
}
