:root {
    /* Dark green primary palette */
    --green-darkest: #081c15;
    --green-dark: #1b4332;
    --green: #2d6a4f;
    --green-mid: #40916c;
    --green-light: #b7e4c7;

    /* Buttons / primary actions */
    --accent: #2d6a4f;
    --accent-dark: #1b4332;

    /* Complementary accent (warm gold/copper) */
    --gold: #c9a24b;
    --gold-dark: #a67c2e;

    --bg: #eef4f0;
    --text: #16241d;
    --muted: #5c7267;

    /* Soft green tints for secondary surfaces */
    --soft: #e2efe7;
    --soft-hover: #cfe4d7;
    --line: #d5e5db;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    /* dvh accounts for the mobile browser address bar so content isn't clipped */
    min-height: 100dvh;
    padding: 24px;
    /* Respect notch / rounded-corner safe areas on phones */
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    -webkit-text-size-adjust: 100%;
    position: relative;
}

/* Faded, slightly desaturated background photo */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("/static/burg.jpg") center center / cover no-repeat;
    filter: saturate(0.55) brightness(0.95);
    z-index: -2;
}

/* Dark green tint over the photo so it reads as a subtle, elegant backdrop */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg,
        rgba(27, 67, 50, 0.72),
        rgba(8, 28, 21, 0.82));
    z-index: -1;
}

.card {
    background: rgba(255, 255, 255, 0.97);
    width: 100%;
    max-width: 520px;
    margin-top: 5vh;
    padding: 32px;
    border-radius: 16px;
    border-top: 4px solid var(--gold);
    box-shadow: 0 12px 40px rgba(8, 28, 21, 0.45);
}

h1 {
    text-align: center;
    margin: 0 0 8px;
    color: var(--green-dark);
    letter-spacing: 0.3px;
}

.subtitle {
    text-align: center;
    color: var(--muted);
    margin-top: 0;
}

.couple-photo {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
    margin: 8px 0 20px;
    border: 3px solid var(--gold);
    box-shadow: 0 8px 24px rgba(8, 28, 21, 0.35);
}

label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--green-dark);
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    /* 16px keeps iOS Safari from auto-zooming when a field is focused */
    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.2);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    /* Removes the 300ms tap delay and the grey tap flash on mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button.primary {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    min-height: 48px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    transition: background 0.15s;
}

.answers {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.answers button {
    padding: 16px;
    /* Comfortable, thumb-friendly tap target on phones */
    min-height: 56px;
    background: var(--soft);
    color: var(--text);
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.answers button:disabled { opacity: 0.6; cursor: default; }

/* Hover effects only where a real pointer exists, so they don't "stick"
   after a tap on touch screens. */
@media (hover: hover) {
    button.primary:hover { background: var(--accent-dark); }
    .answers button:hover {
        background: var(--soft-hover);
        border-left-color: var(--gold);
        transform: translateY(-1px);
    }
}

.answers button:active {
    background: var(--soft-hover);
    border-left-color: var(--gold);
}

.progress {
    text-align: center;
    color: var(--gold-dark);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

h2 { color: var(--green-dark); }

.error { color: #b23b3b; min-height: 1.2em; text-align: center; }

.results-link {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    min-height: 48px;
    box-sizing: border-box;
    background: var(--gold);
    color: var(--green-darkest);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.results-link:active { background: var(--gold-dark); color: #fff; }

@media (hover: hover) {
    .results-link:hover { background: var(--gold-dark); color: #fff; }
}

.hidden { display: none; }

/* Tighter layout on small phones */
@media (max-width: 480px) {
    body { padding: 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .card { padding: 20px; margin-top: 2vh; border-radius: 12px; }
    h1 { font-size: 1.5rem; }
}
