/* Colors from the WATA logo and waterburytrails.com:
   aqua W block #70CCD0, charcoal #2E2E2E, light gray #F2F2F2. */
:root {
    --bg: #f2f2f2;
    --surface: #ffffff;
    --text: #2e2e2e;
    --muted: #5b5b5b;
    --logo: #70ccd0;          /* the color around the W */
    --logo-strong: #52b8bd;   /* pressed */
    --on-logo: #1c1c1c;
    --brand: #1f6f73;         /* darker logo aqua, readable as text on white */
    --on-brand: #ffffff;
    --header-bg: #2e2e2e;
    --on-header: #ffffff;
    --border: #b6b6b6;
    --warn-bg: #fff3d6;
    --warn-text: #6b4a00;
    --ok-bg: #dcf2f3;
    --ok-text: #164f52;
    --error: #a3261b;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1c1c1c;
        --surface: #2e2e2e;
        --text: #f2f2f2;
        --muted: #b6b6b6;
        --logo: #70ccd0;
        --logo-strong: #8ad8db;
        --on-logo: #1c1c1c;
        --brand: #70ccd0;
        --on-brand: #1c1c1c;
        --header-bg: #111111;
        --on-header: #ffffff;
        --border: #5b5b5b;
        --warn-bg: #3a2f12;
        --warn-text: #f3d68c;
        --ok-bg: #1d3a3c;
        --ok-text: #b5e6e8;
        --error: #ff8a7d;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

header {
    background: var(--header-bg);
    color: var(--on-header);
    border-bottom: 5px solid var(--logo);
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}

.brand { font-weight: 700; letter-spacing: 0.02em; }

main {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

h1 { font-size: 1.5rem; line-height: 1.2; margin: 8px 0 20px; }

.big-button {
    display: block;
    width: 100%;
    min-height: 88px;
    border: 0;
    border-radius: 16px;
    background: var(--logo);
    color: var(--on-logo);
    font: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    margin: 20px 0 12px;
}
.big-button:active { background: var(--logo-strong); }
.big-button:disabled { opacity: 0.6; }

.secondary-button {
    min-height: 64px;
    font-size: 1.15rem;
    background: var(--surface);
    color: var(--brand);
    border: 2px solid var(--brand);
}

.link-button {
    background: none;
    border: 0;
    padding: 8px 0;
    color: var(--brand);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.hint { color: var(--muted); font-size: 0.95rem; margin: 6px 0; }
.secondary { text-align: center; margin-top: 16px; }

.status {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0 0 16px;
}
.status.ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.status.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }

.banner {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    background: var(--warn-bg);
    color: var(--warn-text);
    padding: 10px 16px;
    font-size: 0.95rem;
}
.banner .link-button { color: inherit; white-space: nowrap; }
.banner.ok { background: var(--ok-bg); color: var(--ok-text); }

label { display: block; font-weight: 600; margin: 16px 0 6px; }

select, textarea, input[type="email"] {
    width: 100%;
    font: inherit;
    font-size: 16px; /* stops iPhone zooming in */
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
}

.photo-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    margin: 8px 0;
    border: 2px dashed var(--brand);
    border-radius: 14px;
    color: var(--brand);
    font-size: 1.1rem;
    cursor: pointer;
}
.photo-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

#photoPreview {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 12px;
    margin: 8px 0;
}
#photoPreview[hidden] { display: none; }

#map {
    height: 260px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.error { color: var(--error); }

footer {
    text-align: center;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
    font-size: 0.9rem;
}
footer a { color: var(--muted); }

[hidden] { display: none !important; }
