/* ─────────────────────────────────────────────────────────────────────────────
   MeshBuddy Portal — style.css  (Light Mode)
───────────────────────────────────────────────────────────────────────────── */

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

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface2: #f0f4f8;
    --border: #d8e1ec;
    --accent: #0077cc;
    --accent-dim: #0062aa;
    --accent-glow: rgba(0, 119, 204, 0.14);
    --danger: #d93025;
    --text: #1a2233;
    --text-muted: #6b7a99;
    --text-dim: #4a5568;
    --radius: 10px;
    --radius-sm: 6px;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'Courier New', monospace;
    --shadow: 0 2px 16px rgba(0, 0, 0, .08);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, .12);
    --nav-h: 60px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.6;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -5%, rgba(0, 119, 204, .07) 0%, transparent 70%);
}

/* ── Nav ── */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
}

.topnav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .45rem;
    letter-spacing: -.01em;
    transition: opacity .2s;
}

.brand:hover {
    opacity: .75;
}


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

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: color .2s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* ── Content ── */
.content {
    flex: 1;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ── Hero ── */
.hero {
    margin-bottom: 2.5rem;
}

.hero-sm {
    margin-bottom: 2rem;
}

.hero-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.03em;
    margin-bottom: .5rem;
    line-height: 1.2;
}

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

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-card {
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

/* ── Form ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
}

.span-2 {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.form-group label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-dim);
}

.req {
    color: var(--accent);
}

.hint {
    font-size: .75rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="number"] {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .95rem;
    padding: .6rem .85rem;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #fff;
}

input::placeholder {
    color: #b0bcd4;
}

input:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

/* ── Map helper ── */
.map-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .6rem;
}

.map-preview {
    background: #e8f4ff;
    border: 1px solid #b3d7f5;
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .85rem;
    color: var(--accent-dim);
}

.map-preview.hidden {
    display: none;
}

.map-preview a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.map-preview a:hover {
    text-decoration: underline;
}

#link-map {
    font-size: .82rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
    font-size: .9rem;
    padding: .6rem 1.3rem;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, background .15s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 119, 204, .25);
}

.btn-primary:hover {
    background: var(--accent-dim);
    box-shadow: 0 4px 16px rgba(0, 119, 204, .35);
}

.btn-secondary {
    background: var(--surface2);
    color: var(--text-dim);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #e8f4ff;
}

.btn-sm {
    font-size: .8rem;
    padding: .4rem .9rem;
}

.btn-danger-sm {
    font-size: .75rem;
    padding: .3rem .7rem;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.btn-danger-sm:hover {
    background: #fecaca;
    border-color: #ef4444;
}

/* ── Form footer ── */
.form-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ── Map picker modal ── */
.map-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 900;
}

.map-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.map-modal:not(.hidden) {
    pointer-events: auto;
}

.map-modal-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: min(720px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.2rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-dim);
    flex-shrink: 0;
}

.btn-close {
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .3rem .75rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.btn-close:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.map-picker-container {
    flex: 1;
    min-height: 400px;
}

.map-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.2rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.coords-display {
    font-family: var(--mono);
    font-size: .82rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* ── Alerts ── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

/* ── Result cards ── */
.result-card {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.result-card.success {
    border-color: #86efac;
    background: #f0fdf4;
}

.result-card.error {
    border-color: #fca5a5;
    background: #fff5f5;
}

.result-icon {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

.result-card h2 {
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: .75rem;
}

.result-card>p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.error-msg {
    color: #b91c1c !important;
}

.result-detail {
    display: inline-flex;
    flex-direction: column;
    gap: .4rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    margin: 0 auto 2rem;
    text-align: left;
    min-width: 280px;
}

.result-detail>div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.result-detail .label {
    color: var(--text-muted);
    font-size: .85rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Reservations table ── */
.table-wrap {
    overflow-x: auto;
}

.res-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.res-table th {
    text-align: left;
    padding: .65rem .85rem;
    font-size: .74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    background: var(--surface2);
}

.res-table td {
    padding: .72rem .85rem;
    border-bottom: 1px solid #eef1f7;
    vertical-align: middle;
}

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

.res-table tbody tr {
    transition: background .15s;
}

.res-table tbody tr:hover {
    background: #f5f8ff;
}

.prefix-badge {
    background: #dbeafe;
    color: #1d4ed8;
    padding: .2rem .55rem;
    border-radius: 4px;
    font-size: .85rem;
    font-weight: 600;
}

.mono {
    font-family: var(--mono);
}

.coords {
    font-size: .82rem;
}

.coords a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.coords a:hover {
    text-decoration: underline;
}

.date {
    color: var(--text-muted);
    white-space: nowrap;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: .78rem;
    color: var(--text-muted);
    background: var(--surface);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .hero-text h1 {
        font-size: 1.6rem;
    }

    .card {
        padding: 1.25rem;
    }

    .result-detail {
        min-width: unset;
        width: 100%;
    }
}