/* 143 FOUNDATION - BARE MINIMUM THEME */
:root {
    --brand-blue: #557c99;   /* Slate Blue */
    --brand-orange: #cc5500; /* CTA Orange */
    --text-dark: #2c3e50;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --spacing: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* --- HEADER --- */
header {
    background-color: var(--brand-blue);
    color: var(--white);
    padding: var(--spacing);
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: 700;
}

header p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* --- MAIN LAYOUT --- */
main {
    flex: 1;
    position: relative; /* Context for absolute map */
    display: flex;
    flex-direction: column;
}

/* The Map fills the background of the main area */
#map-container {
    flex: 1;
    background-color: #e5e3df; /* Google Maps default grey */
    width: 100%;
    height: 100%;
}

/* --- INTERFACE OVERLAYS --- */
/* The card that floats on top of the map */
#ui-layer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 5;
}

.card-panel {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
}

/* --- FORM ELEMENTS --- */
input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; /* Fix padding width issues */
    font-size: 1rem;
}

button.cta-btn {
    background-color: var(--brand-orange);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

button.cta-btn:hover {
    background-color: #a34400;
}

/* --- UTILITY CLASSES --- */
.hidden { display: none !important; }
.loading { opacity: 0.5; pointer-events: none; }

/* --- SHARED NAVIGATION --- */
#site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 68px;
    background: var(--brand-blue);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    gap: 16px;
}

/* Stacked logo: SVG above "PASS IT ON" text */
.nav-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-decoration: none;
    flex-shrink: 0;
    width: 90px;            /* fixed width = approx "PASS IT ON" text width */
}

.nav-logo-img {
    width: 100%;            /* fills the 90px container */
    height: auto;           /* proportional: 90 × (475/1024) ≈ 42px */
    display: block;
}

.nav-logo-text {
    color: white;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.nav-links {
    display: flex;
    gap: 24px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover,
.nav-link-active {
    color: white;
    border-bottom-color: rgba(255,255,255,0.6);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.nav-user-name {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-auth-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 5px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.nav-auth-btn:hover { background: rgba(255,255,255,0.28); }

/* --- BUTTONS --- */
.btn-secondary {
    background: white;
    color: var(--brand-blue);
    border: 2px solid var(--brand-blue);
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

/* --- MISSING VARIABLE --- */
:root { --text-light: #6c757d; }

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 540px) {
    /* Nav: hide user name to prevent overflow */
    .nav-user-name { display: none; }
    .nav-inner { padding: 0 12px; gap: 8px; }
    .nav-logo { width: 74px; }
    .nav-links { gap: 12px; }
    .nav-auth-btn { padding: 5px 10px; font-size: 0.8rem; }
}

@media (max-width: 400px) {
    /* Very small phones: compress nav further */
    .nav-logo { width: 64px; }
    .nav-logo-text { font-size: 0.6rem; }
    .nav-link { font-size: 0.82rem; }
}