/* ==========================================================================
   Tree Top Hospital — Feedback Form
   Bold immersive redesign · self-contained (overrides Bootstrap where needed)
   ========================================================================== */

:root {
    --ttf-green:        #009943;
    --ttf-green-deep:   #007a36;
    --ttf-green-dark:   #00602a;
    --ttf-green-soft:   #e7f6ee;
    --ttf-accent:       #ff7597;   /* legacy brand send-button pink, reused as a warm CTA */
    --ttf-ink:          #1f2a2e;
    --ttf-muted:        #6b7b80;
    --ttf-line:         #e3e9e7;
    --ttf-surface:      #f4f8f6;
    --ttf-white:        #ffffff;
    --ttf-radius:       22px;
    --ttf-radius-sm:    13px;
    --ttf-shadow:       0 28px 60px -22px rgba(0, 60, 28, .35);
    --ttf-shadow-soft:  0 10px 30px -14px rgba(0, 60, 28, .28);
    --ttf-ring:         0 0 0 4px rgba(0, 153, 67, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body#page-top {
    margin: 0;
    background: var(--ttf-surface);
    color: var(--ttf-ink);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.ttf-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ============================== HERO ============================== */
.ttf-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(56px, 11vw, 120px) 20px clamp(120px, 16vw, 190px);
    text-align: center;
    isolation: isolate;
}
.ttf-hero__media {
    position: absolute; inset: 0; z-index: -2;
    /* Pure brand-green gradient with soft radial highlights for depth. */
    background:
        radial-gradient(60% 80% at 18% 12%, rgba(0,200,98,.35), transparent 55%),
        radial-gradient(70% 90% at 88% 8%, rgba(0,170,80,.30), transparent 58%),
        linear-gradient(155deg, var(--ttf-green) 0%, var(--ttf-green-deep) 50%, var(--ttf-green-dark) 100%);
}
.ttf-hero__wash {
    position: absolute; inset: 0; z-index: -1;
    /* Faint leaf-motif texture echoing the TTH mark, very subtle. */
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,.06) 1px, transparent 0);
    background-size: 22px 22px;
    opacity: .8;
}
.ttf-hero__content {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    color: #fff;
    animation: ttf-rise .7s cubic-bezier(.2,.7,.3,1) both;
}
.ttf-hero__logo {
    height: clamp(82px, 12vw, 116px);
    width: auto;
    margin-bottom: 22px;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.22));
}
.ttf-hero__title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(1.9rem, 5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -.02em;
    margin: 0 0 .5rem;
    text-shadow: 0 2px 18px rgba(0,40,18,.3);
}
.ttf-hero__lede {
    font-size: clamp(1rem, 2.3vw, 1.18rem);
    color: rgba(255,255,255,.92);
    margin: 0 auto;
    max-width: 540px;
}
.ttf-hero__curve {
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    width: 100%; height: clamp(50px, 7vw, 80px);
    display: block;
}

/* ============================== STAGE / CARD ============================== */
.ttf-stage {
    flex: 1;
    padding: 0 18px 64px;
    margin-top: clamp(-90px, -11vw, -130px); /* overlap the hero */
    position: relative;
    z-index: 2;
}
.ttf-card {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: var(--ttf-radius);
    box-shadow: var(--ttf-shadow);
    padding: clamp(22px, 4vw, 40px);
    animation: ttf-rise .7s .08s cubic-bezier(.2,.7,.3,1) both;
}

/* ============================== STEPS / PROGRESS ============================== */
.ttf-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    counter-reset: step;
}
.ttf-steps__item {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    color: var(--ttf-muted);
    font-size: .82rem;
    font-weight: 600;
    position: relative;
}
.ttf-steps__item:not(:last-child)::after {
    content: "";
    flex: 1;
    height: 2px;
    margin-left: 4px;
    background: var(--ttf-line);
    border-radius: 2px;
    transition: background .35s ease;
}
.ttf-steps__dot {
    flex: none;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--ttf-white);
    border: 2px solid var(--ttf-line);
    font-size: .85rem;
    transition: all .35s ease;
}
.ttf-steps__label { white-space: nowrap; }
.ttf-steps__item.is-active .ttf-steps__dot {
    background: var(--ttf-green);
    border-color: var(--ttf-green);
    color: #fff;
    box-shadow: var(--ttf-ring);
}
.ttf-steps__item.is-active { color: var(--ttf-green-deep); }
.ttf-steps__item.is-done .ttf-steps__dot {
    background: var(--ttf-green);
    border-color: var(--ttf-green);
    color: #fff;
    font-size: 0;
}
.ttf-steps__item.is-done .ttf-steps__dot::after {
    content: "✓"; font-size: .85rem; color: #fff;
}
.ttf-steps__item.is-done::after { background: var(--ttf-green); }

@media (max-width: 460px) {
    .ttf-steps__label { display: none; }
    .ttf-steps__item { flex: 0 1 auto; }
    .ttf-steps__item:not(:last-child)::after { min-width: 22px; }
}

/* ============================== STEP CONTENT ============================== */
.ttf-step { display: block; animation: ttf-fade .4s ease both; }
.ttf-step__head { margin-bottom: 22px; }
.ttf-step__title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--ttf-ink);
    margin: 0 0 4px;
    letter-spacing: -.01em;
}
.ttf-step__hint { color: var(--ttf-muted); margin: 0; font-size: .95rem; }

/* ============================== FIELDS ============================== */
.ttf-field { margin-bottom: 18px; }
.ttf-field label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--ttf-ink);
    margin-bottom: 7px;
}
.ttf-field--required label::after {
    content: " *";
    color: var(--ttf-green);
    font-weight: 700;
}
.ttf-optional { color: var(--ttf-muted); font-weight: 400; }

.ttf-field input,
.ttf-select select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ttf-ink);
    background: var(--ttf-white);
    border: 1.5px solid var(--ttf-line);
    border-radius: var(--ttf-radius-sm);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    appearance: none;
}
.ttf-field input::placeholder { color: #aab5b2; }
.ttf-field input:focus,
.ttf-select select:focus {
    outline: none;
    border-color: var(--ttf-green);
    box-shadow: var(--ttf-ring);
    background: #fff;
}
.ttf-field.has-error input { border-color: #e23d4d; box-shadow: 0 0 0 4px rgba(226,61,77,.14); }

/* custom select chevron */
.ttf-select { position: relative; }
.ttf-select::after {
    content: "";
    position: absolute;
    right: 18px; top: 50%;
    width: 10px; height: 10px;
    border-right: 2px solid var(--ttf-muted);
    border-bottom: 2px solid var(--ttf-muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
    transition: border-color .2s ease;
}
.ttf-select select { padding-right: 44px; cursor: pointer; }
.ttf-select select:focus ~ ::after { border-color: var(--ttf-green); }

/* ============================== QUESTIONS (injected) ============================== */
.ttf-questions { margin-bottom: 8px; }
.ttf-questions__loading {
    color: var(--ttf-muted);
    text-align: center;
    padding: 28px 0;
    font-size: .95rem;
}
/* Injected partial wraps everything in .form-group; style its contents */
#form_questions .form-group > h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ttf-ink);
    margin: 0 0 12px;
}
#form_questions .form-group > h4 label { margin: 0; cursor: default; }
/* text answers */
#form_questions .form-control {
    width: 100%;
    padding: 13px 15px;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid var(--ttf-line);
    border-radius: var(--ttf-radius-sm);
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
#form_questions .form-control:focus {
    outline: none;
    border-color: var(--ttf-green);
    box-shadow: var(--ttf-ring);
}
/* option chips (checkbox choices) */
#form_questions .form-check-inline {
    display: inline-flex;
    align-items: center;
    margin: 0 8px 8px 0;
    padding: 0;
}
#form_questions .form-check-inline .form-check-input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
#form_questions .form-check-inline .form-check-label {
    cursor: pointer;
    padding: 9px 18px;
    border: 1.5px solid var(--ttf-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ttf-ink);
    font-size: .92rem;
    font-weight: 500;
    line-height: 1.2;
    transition: all .18s ease;
    user-select: none;
}
#form_questions .form-check-inline .form-check-label:hover {
    border-color: var(--ttf-green);
    color: var(--ttf-green-deep);
}
#form_questions .form-check-inline .form-check-input:checked + .form-check-label {
    background: var(--ttf-green);
    border-color: var(--ttf-green);
    color: #fff;
    box-shadow: var(--ttf-shadow-soft);
}
#form_questions .form-check-inline .form-check-input:focus-visible + .form-check-label {
    box-shadow: var(--ttf-ring);
}
/* divider between questions → soft card separation */
#form_questions hr {
    border: 0;
    border-top: 1px solid var(--ttf-line);
    margin: 22px 0;
}
#form_questions .form-group > .form-group { margin-bottom: 4px; }

/* ============================== ACTIONS / BUTTONS ============================== */
.ttf-actions {
    margin-top: 28px;
    display: flex;
    justify-content: flex-end;
}
.ttf-actions--split { justify-content: space-between; align-items: center; }

.ttf-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 13px 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}
.ttf-btn:active { transform: translateY(1px) scale(.99); }
.ttf-btn:disabled { opacity: .45; cursor: not-allowed; }
.ttf-btn__arrow { transition: transform .2s ease; }
.ttf-btn:not(:disabled):hover .ttf-btn__arrow { transform: translateX(3px); }

.ttf-btn--primary {
    background: linear-gradient(135deg, var(--ttf-green) 0%, var(--ttf-green-deep) 100%);
    color: #fff;
    box-shadow: var(--ttf-shadow-soft);
}
.ttf-btn--primary:not(:disabled):hover { box-shadow: 0 14px 28px -10px rgba(0,120,52,.55); }

.ttf-btn--success {
    background: linear-gradient(135deg, #00b551 0%, var(--ttf-green) 100%);
    color: #fff;
    box-shadow: 0 12px 26px -10px rgba(0,150,66,.6);
}
.ttf-btn--success:not(:disabled):hover { filter: brightness(1.04); }

.ttf-btn--ghost {
    background: transparent;
    color: var(--ttf-muted);
    padding-left: 14px; padding-right: 18px;
}
.ttf-btn--ghost:hover { color: var(--ttf-green-deep); }

.ttf-footnote {
    text-align: center;
    color: var(--ttf-muted);
    font-size: .82rem;
    margin: 26px 0 0;
}

/* ============================== SUCCESS OVERLAY ============================== */
.ttf-success {
    position: fixed; inset: 0;
    z-index: 1000;
    display: grid; place-items: center;
    padding: 20px;
    background: rgba(0, 60, 28, .45);
    backdrop-filter: blur(6px);
    animation: ttf-fade .3s ease both;
}
.ttf-success__card {
    background: #fff;
    border-radius: var(--ttf-radius);
    box-shadow: var(--ttf-shadow);
    padding: 44px 36px 36px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: ttf-pop .45s cubic-bezier(.2,.8,.3,1.2) both;
}
.ttf-success__check {
    width: 84px; height: 84px;
    margin: 0 auto 18px;
}
.ttf-success__check svg { width: 100%; height: 100%; }
.ttf-success__check circle {
    stroke: var(--ttf-green); stroke-width: 3;
    stroke-dasharray: 151; stroke-dashoffset: 151;
    animation: ttf-stroke .6s .1s ease forwards;
}
.ttf-success__check path {
    stroke: var(--ttf-green); stroke-width: 4;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 40; stroke-dashoffset: 40;
    animation: ttf-stroke .4s .55s ease forwards;
}
.ttf-success__title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--ttf-ink);
    margin: 0 0 6px;
}
.ttf-success__text { color: var(--ttf-muted); margin: 0 0 24px; }

/* ============================== KEYFRAMES ============================== */
@keyframes ttf-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes ttf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ttf-pop  { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes ttf-stroke { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
