/* Sloop Koala intake form — minimal, registration-card style */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2933;
    line-height: 1.5;
    min-height: 100vh;
    background-color: #f3ecda;
    background-image:
        radial-gradient(ellipse 55% 45% at 8% 5%, rgba(112, 199, 130, 0.40) 0%, transparent 60%),
        radial-gradient(ellipse 50% 45% at 95% 18%, rgba(214, 178, 92, 0.30) 0%, transparent 60%),
        radial-gradient(ellipse 60% 55% at 95% 95%, rgba(45, 95, 63, 0.45) 0%, transparent 65%),
        radial-gradient(ellipse 55% 50% at 5% 95%, rgba(214, 178, 92, 0.38) 0%, transparent 65%);
    background-attachment: fixed;
}

.intake-page {
    max-width: 720px;
    margin: 28px auto;
    padding: 0 16px 40px;
}

/* --- Dark green header card --- */
.page-header {
    position: relative;
    overflow: hidden;
    background: #103527;
    color: #f0f5ec;
    padding: 36px 28px 32px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 8px 22px rgba(16, 53, 39, 0.18);
}

.page-header::before,
.page-header::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.page-header::before {
    top: -30px;
    left: -30px;
    width: 110px;
    height: 110px;
    background: rgba(112, 199, 130, 0.18);
}

.page-header::after {
    bottom: -40px;
    right: -25px;
    width: 130px;
    height: 130px;
    background: rgba(112, 199, 130, 0.14);
}

.page-header > * { position: relative; z-index: 1; }

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    color: #8ed1a1;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 0 0 10px;
    font-size: 1.85rem;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.header-link { margin: 0; }
.header-link a {
    color: #c8e6c9;
    text-decoration: none;
    border-bottom: 1px solid rgba(200, 230, 201, 0.45);
    font-size: 0.95rem;
}
.header-link a:hover { color: #fff; border-bottom-color: #fff; }

h2 { margin-top: 0; color: #103527; }
a { color: #2d5f3f; }

/* --- Sign-in controls (hidden by default; shown by firebase-auth.js) --- */
#firebaseAuthControls {
    display: none;
    margin: 18px 0 12px;
    color: #1f2933;
    text-align: center;
}

#firebaseAuthControls button,
#firebaseAuthControls input {
    margin: 4px;
    vertical-align: middle;
}

#firebaseAuthControls input[type="email"] {
    padding: 8px 10px;
    border: 1px solid #b9bfc7;
    border-radius: 6px;
    background: #fff;
    color: #1f2933;
    font: inherit;
    min-width: 200px;
}

#firebaseAuthStatus {
    margin-top: 8px;
    font-weight: 500;
    color: #2d5f3f;
    min-height: 1.2em;
}

/* --- Signed-out auth row --- */
.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-or {
    color: #5a6470;
    font-size: 0.9rem;
    padding: 0 4px;
}

/* --- Signed-in profile chip --- */
.profile-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    padding: 6px 8px 6px 6px;
    background: #ffffff;
    border: 1px solid #e0d8c5;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(16, 53, 39, 0.08);
    width: fit-content;
    max-width: 100%;
}

.profile-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2d5f3f;
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.profile-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: left;
    min-width: 0;
    max-width: 220px;
}

.profile-name {
    font-weight: 600;
    color: #103527;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    color: #5a6470;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#firebaseAuthControls .profile-signout {
    margin: 0;
    padding: 6px 9px;
    background: transparent;
    color: #5a6470;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: normal;
    line-height: 1;
}

#firebaseAuthControls .profile-signout:hover {
    background: rgba(192, 60, 60, 0.10);
    color: #c03c3c;
}

/* --- Toolbar (Auto Populate / Clear / Search) --- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
    justify-content: center;
}

/* --- Form card --- */
form, #reviewSection {
    background: #ffffff;
    color: #1f2933;
    padding: 26px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(16, 53, 39, 0.10);
    accent-color: #2d5f3f;
}

#reviewSection { display: none; margin-top: 20px; }

form label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a202c;
}

form input[type="text"],
form input[type="email"],
form input[type="datetime-local"],
form input[type="file"],
form select,
form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cdd3c2;
    border-radius: 8px;
    font: inherit;
    font-size: 0.98rem;
    background: #fff;
    color: #1a202c;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

form input::placeholder,
form textarea::placeholder {
    color: #9aa3ad;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: #2d5f3f;
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.16);
}

form textarea { resize: vertical; min-height: 110px; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.checkbox-row label { margin: 0; font-weight: 400; color: #1f2933; }

button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    background: #2d5f3f;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

button:hover { background: #1c4530; }
button:focus-visible { outline: 2px solid #d6b25c; outline-offset: 2px; }

form > button[type="button"] { margin-top: 22px; }

/* --- Inline help icon (replaces "(Help)" text) --- */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 50%;
    background: #2d5f3f;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    cursor: help;
}

.help-icon:hover,
.help-icon:focus {
    background: #d6b25c;
    color: #103527;
    outline: none;
}

.help-icon::after {
    content: attr(data-help);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1a202c;
    color: #ffffff;
    padding: 9px 12px;
    border-radius: 6px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.45;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    text-align: left;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
}

.help-icon::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: #1a202c;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
}

.help-icon:hover::after,
.help-icon:focus::after,
.help-icon:hover::before,
.help-icon:focus::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#reviewContent {
    white-space: pre-wrap;
    background: #f4f1e7;
    padding: 12px;
    border-radius: 6px;
}

#imagePreview {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 6px;
}

/* --- Contact us footer --- */
.contact-block {
    margin-top: 20px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #e0d8c5;
    border-radius: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: #4a5160;
}

.contact-block p { margin: 0; }

.contact-block strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #103527;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.contact-block a {
    color: #2d5f3f;
    text-decoration: none;
    font-weight: 600;
}

.contact-block a:hover { text-decoration: underline; }

/* --- Mobile --- */
@media (max-width: 600px) {
    .intake-page { margin: 14px auto; padding: 0 10px 28px; }
    .page-header { padding: 26px 18px 22px; }
    .page-header h1 { font-size: 1.45rem; }
    .eyebrow { font-size: 0.7rem; }
    form, #reviewSection { padding: 18px; }
    .toolbar { gap: 6px; }
    .toolbar button { flex: 1 1 100%; }
    button { padding: 10px 14px; }
}
