/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    background: #f5f5f0;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #5d4037; }

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
    background: #5d4037;
    color: #fff;
    gap: 1rem;
    position: relative;
    z-index: 1000;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    margin-right: auto;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    font-size: 0.9rem;
    opacity: 0.85;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.85;
}

.nav-link:hover { opacity: 1; }
.nav-link.nav-active { opacity: 1; font-weight: 600; }

.logout-form { display: inline; }
.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.85;
}
.logout-btn:hover { opacity: 1; }

/* Announcement banner */
.announcement-banner {
    background: #fff3cd;
    color: #856404;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #ffc107;
}

/* Containers */
.container {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

.container-wide {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

.container-narrow {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-full {
    flex: 1;
    width: 100%;
    padding: 0;
}

/* Flash messages */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.flash-error {
    background: #fde8e8;
    color: #991b1b;
    border: 1px solid #f5c6c6;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== HOMEPAGE ===== */

.home-hero {
    text-align: center;
    padding: 3.5rem 1rem 2.5rem;
}

.home-hero h1 {
    font-size: 2.5rem;
    color: #5d4037;
    margin-bottom: 0.25rem;
}

.hero-date {
    font-size: 1.15rem;
    color: #8d6e63;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hero-tagline {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.hero-time {
    font-size: 0.95rem;
    color: #999;
    margin-bottom: 1.25rem;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.home-about {
    text-align: center;
    color: #555;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Sections */
.home-section {
    margin-bottom: 2.5rem;
}

.section-title {
    text-align: center;
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 1.25rem;
}

.section-cta {
    text-align: center;
    margin-top: 1.25rem;
}

/* Featured vendors grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.featured-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}

.featured-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.featured-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 0.75rem;
    display: block;
}

.featured-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e0db;
    color: #5d4037;
    font-size: 2rem;
    font-weight: 700;
}

.featured-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.featured-card p {
    font-size: 0.8rem;
    color: #777;
}

/* Home sponsors row */
.home-sponsors { text-align: center; }

.sponsor-tier {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.sponsor-logo-link {
    display: inline-block;
}

.sponsor-logo {
    display: block;
    object-fit: contain;
}

.sponsor-logo-title,
.sponsor-logo-platinum { height: 80px; }
.sponsor-logo-gold { height: 60px; }
.sponsor-logo-silver { height: 48px; }
.sponsor-logo-community { height: 36px; }

.sponsor-name-text {
    font-weight: 600;
    color: #5d4037;
}

.sponsor-name-title,
.sponsor-name-platinum { font-size: 1.1rem; }
.sponsor-name-gold { font-size: 1rem; }
.sponsor-name-silver,
.sponsor-name-community { font-size: 0.9rem; }

/* ===== VENDOR DIRECTORY ===== */

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #333;
}

.page-subtitle {
    color: #777;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.filter-btn {
    padding: 0.5rem 0.85rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    color: #555;
    transition: all 0.15s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.filter-btn:hover {
    border-color: #5d4037;
    color: #5d4037;
}

.filter-btn.active {
    background: #5d4037;
    color: #fff;
    border-color: #5d4037;
}

/* Vendor card grid */
.vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.vendor-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.15s, transform 0.15s;
}

.vendor-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.vendor-card-img {
    height: 180px;
    overflow: hidden;
    background: #e8e0db;
}

.vendor-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vendor-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #5d4037;
}

.vendor-card-body {
    padding: 0.75rem 1rem 1rem;
    flex: 1;
}

.vendor-card-name {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.vendor-card-desc {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.vendor-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tag {
    display: inline-block;
    background: #f0ebe8;
    color: #5d4037;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.vendor-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #e6a817;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Save / Star button */
.save-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: color 0.15s, background 0.15s;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.save-btn:hover {
    color: #d32f2f;
    background: #fff;
}

.save-btn.saved {
    color: #d32f2f;
    background: #fff;
}

.save-btn.saved::after {
    content: '\2665';  /* filled heart */
}

.save-btn:not(.saved)::after {
    content: '\2661';  /* empty heart */
}

/* Hide any inner text when CSS ::after is used */
.save-btn { font-size: 0; }
.save-btn::after { font-size: 1.1rem; }

/* Detail page save button (inline next to name) */
.detail-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.detail-name-row .detail-name {
    margin-bottom: 0;
}

.save-btn-detail {
    position: static;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.save-btn-detail::after { font-size: 1.3rem; }

/* Map popup */
.map-popup {
    min-width: 180px;
    max-width: 220px;
}

.popup-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
    display: block;
}

.popup-name {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
}

.popup-desc {
    margin: 4px 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
}

.popup-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 4px 0 6px;
}

.popup-cat {
    font-size: 0.65rem;
    background: #efebe9;
    color: #795548;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: capitalize;
}

.popup-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

.popup-link {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Save button inside map popups — override absolute positioning */
.leaflet-popup-content .save-btn {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    flex-shrink: 0;
}

/* Green tint for saved markers on map */
.marker-saved {
    filter: hue-rotate(90deg) saturate(1.5);
}

/* ===== VENDOR DETAIL ===== */

.detail-back {
    margin-bottom: 1rem;
}

.detail-back a {
    color: #5d4037;
    text-decoration: none;
    font-size: 0.9rem;
}

.detail-back a:hover { text-decoration: underline; }

.vendor-detail {
    max-width: 800px;
    margin: 0 auto;
}

.detail-photo {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.detail-photo img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.detail-name {
    font-size: 1.75rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.special-deal {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    color: #795548;
}

.detail-description {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.detail-info {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
    flex-shrink: 0;
}

.detail-row a {
    color: #5d4037;
    text-decoration: none;
}
.detail-row a:hover { text-decoration: underline; }

.detail-social {
    display: flex;
    gap: 0.75rem;
}

.detail-map {
    height: 280px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

/* ===== MAP PAGE ===== */

#map-page {
    width: 100%;
    height: calc(100vh - 50px);
    /* navbar ~50px */
}

/* Gold tint for featured markers */
.marker-featured {
    filter: hue-rotate(190deg) saturate(1.5);
}

/* ===== SPONSORS PAGE ===== */

.sponsors-section {
    margin-bottom: 2rem;
}

.sponsors-tier-heading {
    font-size: 1.15rem;
    color: #5d4037;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
}

.sponsors-grid {
    display: grid;
    gap: 1rem;
}

.sponsors-grid-title,
.sponsors-grid-platinum {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.sponsors-grid-gold {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.sponsors-grid-silver,
.sponsors-grid-community {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.sponsor-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.sponsor-card-logo {
    margin-bottom: 0.75rem;
}

.sponsor-card-logo img {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
}

.sponsor-card-name {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sponsor-card-name a {
    color: #333;
    text-decoration: none;
}

.sponsor-card-name a:hover { text-decoration: underline; }

.sponsor-card-desc {
    font-size: 0.85rem;
    color: #777;
}

/* ===== BUTTONS ===== */

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: #5d4037;
    color: #fff;
}

.btn-primary:hover {
    background: #4e342e;
}

.btn-outline {
    background: transparent;
    color: #5d4037;
    border: 2px solid #5d4037;
}

.btn-outline:hover {
    background: #5d4037;
    color: #fff;
}

.btn-lg {
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
}

/* Cards (generic) */
.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Hero (legacy fallback) */
.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    color: #5d4037;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    color: #8d6e63;
}

/* Login */
.login-wrap {
    max-width: 360px;
    margin: 4rem auto;
    text-align: center;
}

.login-wrap h1 {
    font-size: 1.5rem;
    color: #5d4037;
    margin-bottom: 1.5rem;
}

.login-form {
    text-align: left;
}

.login-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #555;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.pw-wrap {
    position: relative;
}

.pw-wrap input {
    padding-right: 2.75rem !important;
}

.pw-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(calc(-50% - 0.5rem));
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #888;
    font-size: 1.1rem;
    line-height: 1;
    width: auto;
}

.pw-toggle:hover {
    color: #555;
}

.login-form button:not(.pw-toggle) {
    width: 100%;
    padding: 0.7rem;
    background: #5d4037;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
}

.login-form button:not(.pw-toggle):hover {
    background: #4e342e;
}

/* Auth pages */
.auth-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.auth-alt {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.75rem;
}

.auth-alt a { color: #5d4037; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

.auth-hint {
    font-size: 0.8rem;
    color: #999;
    margin: -0.25rem 0 0.75rem;
}

.auth-select {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-family: inherit;
    background: #fff;
}

.auth-divider {
    border-top: 1px solid #e0e0e0;
    margin: 1.25rem 0;
}

.auth-logout-btn {
    width: 100%;
    padding: 0.6rem;
    background: #fff;
    color: #c62828;
    border: 1px solid #c62828;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: background 0.15s;
}

.auth-logout-btn:hover {
    background: #fbe9e7;
}

/* What's New */
.wn-entry { margin-bottom: 1.5rem; }
.wn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.wn-version {
    background: #5d4037;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}
.wn-date {
    font-size: 0.85rem;
    color: #888;
}
.wn-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}
.wn-description p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #444;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 4rem;
    color: #5d4037;
    margin-bottom: 0.5rem;
}

.error-page p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    color: #888;
    padding: 2rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid #e0e0e0;
}

.footer-sep { margin: 0 0.5rem; }

.footer-link {
    color: #888;
    text-decoration: underline;
}

/* ===== BECOME A VENDOR / SALES PAGE ===== */

.sales-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.sales-hero h1 {
    font-size: 2.2rem;
    color: #5d4037;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.sales-hero-date {
    font-size: 1.1rem;
    color: #8d6e63;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sales-hero-sub {
    font-size: 1.05rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.sales-section {
    margin-bottom: 2.5rem;
}

.sales-form-intro {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Benefits grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.benefit-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.benefit-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.benefit-card h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.4rem;
}

.benefit-card p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

/* Tier comparison table */
.tier-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tier-table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.tier-table th,
.tier-table td {
    padding: 0.6rem 1rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.tier-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.tier-table th:first-child,
.tier-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: #333;
}

.tier-table tr:last-child td {
    border-bottom: none;
}

.tier-highlight {
    background: #fff8e1 !important;
    color: #e65100 !important;
}

/* Booth callout */
.booth-callout {
    background: #efebe9;
    border: 1px solid #d7ccc8;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.booth-callout h3 {
    color: #5d4037;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.booth-callout p {
    color: #666;
    font-size: 0.95rem;
}

/* Inquiry form */
.inquiry-form {
    max-width: 560px;
    margin: 0 auto;
}

.inquiry-form .form-row {
    margin-bottom: 1rem;
}

.inquiry-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.3rem;
}

.inquiry-form input[type="text"],
.inquiry-form input[type="email"],
.inquiry-form input[type="tel"],
.inquiry-form textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.inquiry-form input:focus,
.inquiry-form textarea:focus {
    outline: none;
    border-color: #5d4037;
    box-shadow: 0 0 0 2px rgba(93, 64, 55, 0.15);
}

.inquiry-form .form-actions {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 0;
    border-top: none;
}

.required { color: #c62828; }

.form-hint-inline {
    font-weight: 400;
    font-size: 0.8rem;
    color: #999;
}

/* Thank you page */
.thanks-page {
    text-align: center;
    padding: 4rem 1rem;
}

.thanks-page h1 {
    font-size: 2rem;
    color: #5d4037;
    margin-bottom: 0.75rem;
}

.thanks-page p {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.thanks-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== PASSPORT / PUNCH CARD ===== */

.passport-page { padding-bottom: 2rem; }

.passport-title {
    text-align: center;
    font-size: 1.8rem;
    color: #5d4037;
    margin-bottom: 0.25rem;
}

.passport-subtitle {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Progress bar */
.progress-wrap { margin-bottom: 2rem; }

.progress-bar {
    position: relative;
    height: 18px;
    background: #e8e0db;
    border-radius: 9px;
    overflow: visible;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8d6e63, #5d4037);
    border-radius: 9px;
    transition: width 0.4s ease;
    min-width: 4px;
}

.tier-marker {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    text-align: center;
}

.tier-marker-dot {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #d7ccc8;
    border: 3px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    margin: 0 auto 4px;
}

.tier-marker-dot.tier-reached {
    background: #5d4037;
}

.tier-marker-label {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.2;
    white-space: nowrap;
}

.progress-count {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

/* Manual entry */
.manual-entry {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.25rem;
}

.manual-entry h2 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.25rem;
}

.manual-entry p {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.75rem;
}

.manual-form { display: inline-block; }

.manual-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.manual-code-input {
    width: 7rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid #d7ccc8;
    border-radius: 6px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.15em;
    font-family: inherit;
    text-transform: uppercase;
}

.manual-code-input:focus {
    outline: none;
    border-color: #5d4037;
    box-shadow: 0 0 0 2px rgba(93, 64, 55, 0.15);
}

/* Stamp grid */
.stamp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.stamp-slot {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.15s;
}

.stamp-slot.stamped {
    background: #efebe9;
    border: 3px solid #8d6e63;
    box-shadow: inset 0 2px 6px rgba(93, 64, 55, 0.2);
    transform: rotate(-2deg);
}

.stamp-slot.stamped:nth-child(even) {
    transform: rotate(2deg);
}

.stamp-slot.stamped:nth-child(3n) {
    transform: rotate(-3deg);
}

.stamp-slot.unstamped {
    background: #fafafa;
    border: 2px dashed #d7ccc8;
}

.stamp-inner {
    text-align: center;
    padding: 0.25rem;
    overflow: hidden;
    width: 100%;
}

.stamp-initial {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #5d4037;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.unstamped-initial {
    color: #ccc;
}

.stamp-name {
    display: block;
    font-size: 0.7rem;
    color: #666;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stamp-slot.unstamped .stamp-name {
    color: #bbb;
}

/* Purchase button */
.purchase-btn {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.6rem;
    border: 1px solid #8d6e63;
    border-radius: 4px;
    background: transparent;
    color: #8d6e63;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    position: relative;
}

.purchase-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 44px;
    min-height: 44px;
}

.purchase-btn:hover {
    background: #efebe9;
}

.purchase-btn.purchased {
    background: #5d4037;
    color: #fff;
    border-color: #5d4037;
}

/* ===== CHECK-IN PAGE ===== */

.checkin-page {
    max-width: 450px;
    margin: 2rem auto;
    text-align: center;
}

.checkin-photo {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.checkin-photo img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

.checkin-vendor-name {
    font-size: 1.5rem;
    color: #5d4037;
    margin-bottom: 0.5rem;
}

.checkin-desc {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.checkin-confirm p {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
}

.checkin-status {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.checkin-status p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.checkin-done {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.checkin-closed {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.checkin-back {
    margin-top: 1.5rem;
}

.checkin-back a {
    color: #5d4037;
    font-size: 0.9rem;
}

/* GPS status indicator */
.gps-status {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 1.5rem;
}

.gps-acquiring { color: #856404; }
.gps-ready { color: #155724; }
.gps-failed { color: #991b1b; }

.gps-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #d7ccc8;
    border-top-color: #5d4037;
    border-radius: 50%;
    animation: gps-spin 0.8s linear infinite;
}

@keyframes gps-spin {
    to { transform: rotate(360deg); }
}

.purchase-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 48px;
        left: 0;
        right: 0;
        background: #5d4037;
        padding: 0.5rem 1rem 1rem;
        z-index: 100;
    }

    .nav-links.nav-open { display: flex; }
    .nav-link { padding: 0.4rem 0; }

    .home-hero h1 { font-size: 1.8rem; }
    .hero-tagline { font-size: 1rem; }
    .container, .container-wide { padding: 1rem 0.75rem; }

    .featured-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .vendor-grid { grid-template-columns: 1fr; }

    .detail-row { flex-direction: column; gap: 0.2rem; }
    .detail-label { min-width: auto; }

    #map-page { height: calc(100vh - 48px); }

    /* Passport mobile */
    .stamp-grid { grid-template-columns: repeat(3, 1fr); }
    .stamp-initial { font-size: 1.2rem; }
    .stamp-name { font-size: 0.65rem; }
    .purchase-btn { font-size: 0.5rem; padding: 0.2rem 0.4rem; }
    .passport-title { font-size: 1.4rem; }

    /* Save button mobile */
    .save-btn { width: 28px; height: 28px; }
    .save-btn::after { font-size: 1rem; }
    .save-btn-detail { width: 32px; height: 32px; }
    .save-btn-detail::after { font-size: 1.15rem; }

    /* Sales page mobile */
    .sales-hero h1 { font-size: 1.6rem; }
    .sales-hero-sub { font-size: 0.95rem; }
    .benefits-grid { grid-template-columns: 1fr; }
    .tier-table { min-width: 380px; }
    .inquiry-form { padding: 0 0.25rem; }
    .inquiry-form input[type="text"],
    .inquiry-form input[type="email"],
    .inquiry-form input[type="tel"],
    .inquiry-form textarea { font-size: 16px; }
}

@media (min-width: 601px) and (max-width: 900px) {
    .stamp-grid { grid-template-columns: repeat(4, 1fr); }
    .vendor-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Leaderboard */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.leaderboard-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.leaderboard-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.leaderboard-table tr:last-child td { border-bottom: none; }

.leader-top3 td {
    background: #fdf6f0;
}

.leader-rank {
    text-align: center;
    font-weight: 600;
    color: #888;
}

.leader-name {
    font-weight: 500;
}

.leader-count {
    font-weight: 600;
    color: #5d4037;
}

.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.rank-gold { background: #f9a825; }
.rank-silver { background: #90a4ae; }
.rank-bronze { background: #a1887f; }

.tier-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}

.tier-badge.tier-standard { background: #e0e0e0; color: #555; }
.tier-badge.tier-featured { background: #fff3e0; color: #e65100; }
.tier-badge.tier-gold { background: #fff8e1; color: #f57f17; }
.tier-badge.tier-silver { background: #eceff1; color: #546e7a; }

/* Event Info page */
.info-page {
    padding-bottom: 2rem;
}

.info-section {
    margin-bottom: 2.5rem;
}

.info-heading {
    font-size: 1.3rem;
    color: #5d4037;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #efebe9;
}

.info-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5d4037;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
}

.info-step p {
    margin-top: 0.2rem;
    color: #666;
    font-size: 0.9rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.info-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.info-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.info-table tr:last-child td { border-bottom: none; }

.info-note {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.info-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
}

.info-card h3 {
    font-size: 1rem;
    color: #5d4037;
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.faq-item summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    font-size: 0.95rem;
}

.faq-item summary:hover {
    background: #fafafa;
}

.faq-item p {
    padding: 0 1rem 0.75rem;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-cta {
    text-align: center;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Countdown timer */
.countdown-wrap {
    text-align: center;
    margin-bottom: 1.25rem;
}

.countdown {
    display: inline-flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.countdown-number {
    font-size: 2rem;
    font-weight: 700;
    color: #5d4037;
    line-height: 1;
}

.countdown-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.crud-table-wrap {
    overflow-x: auto;
}
