* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Arial, sans-serif;
    min-height: 100vh;
    color: #ffffff;
    background: #0f1117;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,76,0,0.18), rgba(255,255,255,0) 30%),
        linear-gradient(220deg, rgba(255,204,0,0.12), rgba(255,255,255,0) 35%),
        radial-gradient(circle at top right, rgba(255,255,255,0.08), rgba(255,255,255,0) 30%),
        linear-gradient(180deg, #11141c 0%, #0b0d13 100%);
    z-index: -3;
}

.race-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: 0.45;
    background-image:
        linear-gradient(90deg, rgba(255,255,255,0.05) 50%, transparent 50%),
        linear-gradient(rgba(255,255,255,0.025) 50%, transparent 50%),
        linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.08) 42% 44%, transparent 44% 100%),
        linear-gradient(295deg, transparent 0 38%, rgba(255,95,31,0.10) 38% 40%, transparent 40% 100%);
    background-size: 24px 24px, 100% 160px, 100% 100%, 100% 100%;
    background-position: center top, center top, center center, center center;
    filter: blur(0.3px);
}

.app-shell {
    width: min(1100px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 40px;
}
.max-shell { padding-top: 22px; }
.center-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 32px; margin-bottom: 6px; }
h2 { font-size: 24px; margin-bottom: 14px; }
.subtext, .muted, .mini-note { color: rgba(255,255,255,0.74); }
.eyebrow {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #ffc857;
    margin-bottom: 8px;
}

.glass-card {
    background: rgba(17, 20, 28, 0.76);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
    padding: 22px;
}
.login-card { width: min(440px, 100%); }
.form-card { max-width: 580px; }
.public-card { width: min(580px, 100%); text-align: center; }
.brand-mark {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, #ff5b1f, #ffb703);
    box-shadow: 0 12px 30px rgba(255, 94, 32, 0.35);
    margin-bottom: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.gap-lg { gap: 18px; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.compact-form .row-gap { display: flex; gap: 10px; }
.row-gap { display: flex; align-items: center; gap: 10px; }
.actions-row, .copy-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.share-box {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

label {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
}

.input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.07);
    color: #ffffff;
    padding: 14px 14px;
    border-radius: 16px;
    outline: none;
    transition: 0.2s ease;
    font-size: 16px;
}
.input:focus {
    border-color: rgba(255,184,0,0.85);
    box-shadow: 0 0 0 4px rgba(255,184,0,0.12);
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 16px;
    padding: 13px 18px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, opacity .15s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-primary {
    background: linear-gradient(135deg, #ff5b1f, #ff9f1c);
    box-shadow: 0 12px 28px rgba(255, 91, 31, 0.24);
}
.btn-secondary {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-dark { background: rgba(0,0,0,0.44); }
.btn-danger {
    background: linear-gradient(135deg, #d7263d, #ff4d6d);
    box-shadow: 0 12px 28px rgba(215, 38, 61, 0.22);
}
.btn-whatsapp {
    background: linear-gradient(135deg, #15b86a, #25d366);
    box-shadow: 0 12px 28px rgba(21,184,106,0.25);
}

.alert {
    padding: 14px 16px;
    border-radius: 18px;
    margin-bottom: 16px;
    font-weight: bold;
    border: 1px solid rgba(255,255,255,0.08);
}
.alert.success { background: rgba(21,184,106,0.18); }
.alert.error { background: rgba(215,38,61,0.18); }
.alert.warning { background: rgba(255,184,0,0.18); color: #ffe7a3; }

.feature-list {
    margin: 0;
    padding: 0 20px 0 0;
    line-height: 1.9;
}
.customer-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.summary-chip, .progress-badge {
    min-width: 120px;
    text-align: center;
    padding: 12px 14px;
    border-radius: 18px;
    font-weight: bold;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.08);
}
.summary-chip.hot, .progress-badge.almost {
    background: rgba(255,184,0,0.18);
    color: #ffe28a;
}
.progress-badge.done {
    background: rgba(21,184,106,0.18);
}

.punch-card-card { position: relative; overflow: hidden; }
.punch-card-card::after {
    content: '🏎️';
    position: absolute;
    left: 22px;
    top: 18px;
    font-size: 54px;
    opacity: 0.12;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.punch-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.public-grid { margin-top: 22px; }
.punch-slot {
    min-height: 82px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.punch-slot span {
    position: relative;
    z-index: 2;
    color: rgba(255,255,255,0.72);
    font-size: 22px;
    font-weight: bold;
}
.punch-slot.filled {
    background: radial-gradient(circle at top, rgba(255,190,60,0.40), rgba(255,91,31,0.28) 45%, rgba(215,38,61,0.38));
    border-color: rgba(255,184,0,0.45);
    box-shadow: 0 10px 25px rgba(255, 91, 31, 0.20), inset 0 0 24px rgba(255,255,255,0.08);
}
.punch-slot.filled::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(135deg, transparent 0 35%, rgba(255,255,255,0.16) 35% 40%, transparent 40% 100%),
      radial-gradient(circle at center, rgba(255,255,255,0.18), transparent 65%);
}
.punch-slot.just-filled {
    animation: punchPop .75s ease-out both;
}

.status-line {
    font-size: 18px;
    font-weight: bold;
    color: #ffd278;
}
.center-text { text-align: center; }

.empty-state {
    text-align: center;
    padding: 12px 4px;
}
.empty-icon {
    font-size: 52px;
    margin-bottom: 10px;
}
.public-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0 12px;
}
.stat-box {
    min-width: 120px;
    border-radius: 18px;
    padding: 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
}
.stat-box strong {
    display: block;
    font-size: 28px;
    margin-bottom: 4px;
}

.reveal-up { animation: revealUp .55s ease-out both; }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }

@keyframes revealUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes punchPop {
    0% { transform: scale(.55) rotate(-9deg); filter: saturate(0.6); }
    55% { transform: scale(1.12) rotate(3deg); }
    100% { transform: scale(1) rotate(0); }
}

@media (max-width: 820px) {
    .grid-2 { grid-template-columns: 1fr; }
    .topbar, .customer-summary, .card-head { flex-direction: column; align-items: stretch; }
    .compact-form .row-gap, .copy-row, .actions-row { flex-direction: column; }
    .punch-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .app-shell { width: min(100% - 18px, 1000px); }
    .glass-card { padding: 18px; border-radius: 20px; }
    h1 { font-size: 27px; }
    h2 { font-size: 21px; }
    .punch-slot { min-height: 72px; border-radius: 18px; }
    .punch-slot span { font-size: 20px; }
    .public-stats { flex-direction: column; }
}
