/* Coca Cola Map — design tokens
   Ink:    #1B1310  (near-black, warm)
   Red:    #F0130C  (bottle red)
   Cream:  #FFF6E9  (label cream)
   Fizz:   #FFC24B  (bubble accent)
   Muted:  #A99C90
*/

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

:root {
    --ink: #1B1310;
    --red: #F0130C;
    --red-dark: #C10D08;
    --cream: #FFF6E9;
    --fizz: #FFC24B;
    --muted: #A99C90;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Archivo', sans-serif;
    background: var(--ink);
    color: var(--cream);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 {
    font-family: 'Archivo Black', sans-serif;
    line-height: 1.05;
    margin: 0 0 0.4em;
}

/* ---------- Nav ---------- */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5vw;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.brand-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 3px rgba(240,19,12,0.25);
}

.nav-links { display: flex; gap: 10px; align-items: center; }

.btn-primary, .btn-ghost, .btn-danger {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-primary { background: var(--red); color: var(--cream); }
.btn-primary:hover { transform: translateY(-1px); background: var(--red-dark); }
.btn-primary.lg { padding: 14px 28px; font-size: 1rem; }

.btn-ghost { background: transparent; color: var(--cream); border: 1.5px solid rgba(255,246,233,0.25); }
.btn-ghost:hover { border-color: var(--cream); }
.btn-ghost.lg { padding: 14px 28px; font-size: 1rem; }

.btn-danger { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.btn-danger:hover { background: var(--red); color: var(--cream); }

/* ---------- Hero ---------- */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 60px 5vw 90px;
    flex-wrap: wrap;
}

.hero-text { flex: 1 1 480px; max-width: 620px; }

.hero-text h1 {
    font-size: clamp(2.6rem, 5.5vw, 4.4rem);
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.hero-text .accent { color: var(--red); }

.hero-text p {
    color: var(--muted);
    font-size: 1.15rem;
    max-width: 46ch;
    margin: 22px 0 32px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-art {
    position: relative;
    flex: 1 1 320px;
    max-width: 420px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.soda-can {
    width: 130px;
    height: 320px;
    border-radius: 60px;
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    position: relative;
    box-shadow: 0 30px 60px -20px rgba(240,19,12,0.5), inset -14px 0 30px rgba(0,0,0,0.25), inset 10px 0 20px rgba(255,255,255,0.08);
    animation: float 5s ease-in-out infinite;
}
.soda-can::before {
    content: '';
    position: absolute;
    top: 18px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 10px;
    border-radius: 6px;
    background: #8f0906;
}
.soda-can::after {
    content: 'COCA COLA MAP';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%) rotate(-90deg);
    font-family: 'Archivo Black', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--cream);
    white-space: nowrap;
}

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

.hero-dot {
    position: absolute;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--fizz);
    opacity: 0.85;
    animation: rise 3.2s ease-in infinite;
}
.dot1 { left: 30%; bottom: 20px; animation-delay: 0s; width: 8px; height: 8px; }
.dot2 { left: 55%; bottom: 10px; animation-delay: 1s; width: 11px; height: 11px; }
.dot3 { left: 45%; bottom: 30px; animation-delay: 2s; width: 6px; height: 6px; }

@keyframes rise {
    0% { transform: translateY(0); opacity: 0.9; }
    100% { transform: translateY(-220px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .soda-can, .hero-dot { animation: none; }
}

/* ---------- Features ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    padding: 20px 5vw 70px;
}

.feature {
    background: rgba(255,246,233,0.04);
    border: 1px solid rgba(255,246,233,0.08);
    border-radius: 18px;
    padding: 28px;
}

.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.95rem; margin: 0; line-height: 1.5; }

/* ---------- How-to ---------- */
.howto {
    padding: 40px 5vw 90px;
    max-width: 760px;
}
.howto h2 { font-size: 1.7rem; text-transform: uppercase; }
.howto p { color: var(--muted); line-height: 1.6; }
.howto a { color: var(--fizz); text-decoration: underline; }

.code-block {
    background: #0F0A08;
    border: 1px solid rgba(255,246,233,0.1);
    border-radius: 12px;
    padding: 16px 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--fizz);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 14px 0;
}

.hint { font-size: 0.85rem; color: var(--muted); }

.site-footer {
    text-align: center;
    padding: 30px 5vw;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid rgba(255,246,233,0.08);
}

/* ---------- Auth pages ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-box {
    width: 100%;
    max-width: 380px;
    background: rgba(255,246,233,0.04);
    border: 1px solid rgba(255,246,233,0.1);
    border-radius: 20px;
    padding: 36px 32px;
}

.auth-box .brand { justify-content: center; margin-bottom: 24px; }
.auth-box h1 { font-size: 1.1rem; }
.auth-box h2 { font-size: 1.5rem; text-transform: uppercase; text-align: center; margin-bottom: 20px; }

.auth-box form { display: flex; flex-direction: column; gap: 16px; }

.auth-box label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.auth-box input {
    background: #0F0A08;
    border: 1px solid rgba(255,246,233,0.15);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--cream);
    font-size: 1rem;
    font-family: inherit;
}
.auth-box input:focus {
    outline: 2px solid var(--red);
    outline-offset: 1px;
}

.auth-box .btn-primary { margin-top: 6px; padding: 13px; }

.switch { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--muted); }
.switch a { color: var(--fizz); }

.alert {
    background: rgba(240,19,12,0.12);
    border: 1px solid rgba(240,19,12,0.4);
    color: #ff8a85;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}
.alert.success {
    background: rgba(255,194,75,0.12);
    border-color: rgba(255,194,75,0.4);
    color: var(--fizz);
}

/* ---------- Account / generic content page ---------- */
.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 5vw 80px;
}
.page-content h1 { text-transform: uppercase; font-size: 2rem; }
.muted { color: var(--muted); }

.panel {
    background: rgba(255,246,233,0.04);
    border: 1px solid rgba(255,246,233,0.1);
    border-radius: 16px;
    padding: 26px 28px;
    margin-top: 22px;
}
.panel h2 { font-size: 1.1rem; text-transform: uppercase; }

.token-box {
    background: #0F0A08;
    border: 1px dashed rgba(255,194,75,0.5);
    color: var(--fizz);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    margin: 12px 0;
}

.steps { color: var(--muted); line-height: 1.8; padding-left: 20px; }
.steps code { color: var(--fizz); }
.steps strong { color: var(--cream); }

/* ---------- Map page ---------- */
.map-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { width: 100%; height: 100%; filter: saturate(0.85); }

.map-stats {
    position: absolute;
    top: 16px; left: 16px;
    background: rgba(27,19,16,0.85);
    border: 1px solid rgba(255,246,233,0.15);
    color: var(--cream);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    z-index: 500;
}
.map-stats span { color: var(--fizz); font-weight: 700; }

.timeline-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 5vw;
    background: #0F0A08;
    border-top: 1px solid rgba(255,246,233,0.1);
}
.timeline-bar input[type="range"] {
    flex: 1;
    accent-color: var(--red);
}
.timeline-bar #timelineLabel {
    min-width: 190px;
    text-align: right;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.cola-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid var(--cream);
    box-shadow: 0 0 0 4px rgba(240,19,12,0.3);
}

/* ---------- Capture page (PWA) ---------- */
.capture-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.capture-wrap {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.brand.center { justify-content: center; }

.status-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,246,233,0.04);
    border: 1px solid rgba(255,246,233,0.12);
    border-radius: 16px;
    padding: 18px 20px;
    transition: border-color 0.2s ease;
}
.status-card.locating { border-color: var(--fizz); }
.status-card.ready { border-color: #4CD07A; }
.status-card.error { border-color: var(--red); }
.status-icon { font-size: 1.6rem; }
.status-text { font-size: 0.95rem; }

.photo-picker { width: 100%; }
.photo-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    border: 1.5px dashed rgba(255,246,233,0.25);
    border-radius: 16px;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.95rem;
    overflow: hidden;
}
.photo-drop img { max-width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; }

.save-btn { width: 100%; }
.save-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hint.center { text-align: center; }
.link-back { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.link-back:hover { color: var(--cream); }

/* ---------- Map popup photo ---------- */
.leaflet-popup-content .popup-photo img {
    width: 160px;
    max-width: 100%;
    border-radius: 10px;
    display: block;
}
.popup-time {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: #1B1310;
    margin-top: 6px;
}

/* ---------- Account entry list ---------- */
.entry-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.entry-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,246,233,0.03);
    border: 1px solid rgba(255,246,233,0.08);
    border-radius: 12px;
    padding: 10px 14px;
}
.entry-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.entry-thumb-empty {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,246,233,0.06);
    font-size: 1.3rem;
}
.entry-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry-time { font-family: 'Courier New', monospace; font-size: 0.85rem; }
.entry-coords { font-size: 0.78rem; }
.btn-danger.sm { padding: 6px 12px; font-size: 0.8rem; }

@media (max-width: 700px) {
    .topnav { padding: 16px 5vw; }
    .hero { padding-top: 30px; }
    .timeline-bar { flex-wrap: wrap; }
    .timeline-bar #timelineLabel { text-align: left; min-width: 0; }
}
