/* ===========================================================
   EcoBot – Premium signup experience
   Sage-green, research-focused SaaS aesthetic
   =========================================================== */

:root {
    --green-900: #1f5a45;
    --green-700: #2f7a61;
    --green-600: #37a06a;
    --green-500: #4cc273;
    --green-300: #a7de83;
    --sage-050: #f4f9f4;
    --sage-100: #eaf4ea;
    --sage-200: #dcecdc;
    --ink-900: #1c2a24;
    --ink-700: #3c4a43;
    --ink-500: #6a7873;
    --ink-300: #9aa8a2;
    --line: #e3ebe4;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(31, 90, 69, 0.06);
    --shadow-md: 0 6px 20px rgba(31, 90, 69, 0.08);
    --shadow-lg: 0 24px 60px rgba(31, 90, 69, 0.12);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --focus: 0 0 0 4px rgba(76, 194, 115, 0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink-900);
    background:
        radial-gradient(1100px 520px at 12% -8%, #eef8ee 0%, rgba(238, 248, 238, 0) 60%),
        radial-gradient(1000px 520px at 100% 110%, #e8f5ec 0%, rgba(232, 245, 236, 0) 55%),
        #fbfdfb;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

/* Botanical corner illustrations */
.botanical {
    position: fixed;
    width: 260px;
    height: 260px;
    fill: none;
    stroke: var(--green-300);
    stroke-width: 2;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
}
.botanical path { fill: rgba(167, 222, 131, 0.10); }
.botanical-tl { top: -30px; left: -30px; }
.botanical-br { bottom: -30px; right: -30px; }

/* Layout shell */
.signup-shell {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 20px 72px;
}

.signup-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 26px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--green-300) 0%, var(--green-500) 100%);
    box-shadow: 0 6px 16px rgba(76, 194, 115, 0.35);
}
.brand-mark svg { fill: #fff; }
.brand-mark .leaf-vein { stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.4; }
.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--green-900);
}

/* Progress indicator */
.progress {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 380px;
    margin: 0 auto 34px;
}
.progress-step {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}
.progress-dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sage-100);
    color: var(--ink-300);
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid var(--line);
    transition: all 0.25s ease;
}
.progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-300);
    transition: color 0.25s ease;
}
.progress-track {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--sage-200);
    overflow: hidden;
}
.progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green-300), var(--green-500));
    transition: width 0.4s ease;
}
.progress-step.is-active .progress-dot {
    background: linear-gradient(135deg, var(--green-300), var(--green-500));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(76, 194, 115, 0.35);
}
.progress-step.is-active .progress-label { color: var(--green-900); }
.progress-step.is-complete .progress-dot {
    background: var(--green-700);
    color: #fff;
    border-color: transparent;
}

/* Steps */
.step { display: none; }
.step.is-active { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-head { text-align: center; margin-bottom: 28px; }
.step-head h1 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink-900);
    margin-bottom: 8px;
}
.step-head p {
    font-size: 0.98rem;
    color: var(--ink-500);
    line-height: 1.55;
    max-width: 440px;
    margin: 0 auto;
}

/* Fields */
.field { margin-bottom: 18px; }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.field label,
.survey-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.reveal input,
.combo-input,
.select-wrap select {
    width: 100%;
    font-family: inherit;
    font-size: 0.98rem;
    color: var(--ink-900);
    background: var(--sage-050);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input::placeholder,
.reveal input::placeholder,
.combo-input::placeholder { color: var(--ink-300); }
.field input:focus,
.reveal input:focus,
.combo-input:focus,
.select-wrap select:focus {
    outline: none;
    border-color: var(--green-500);
    background: #fff;
    box-shadow: var(--focus);
}
.field input:hover,
.select-wrap select:hover,
.combo-input:hover { border-color: var(--green-300); }

/* Password */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 66px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--green-700);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}
.password-toggle:hover { background: var(--sage-100); }

/* Validation */
.field-error {
    display: none;
    font-size: 0.8rem;
    color: #c0392b;
    margin-top: 6px;
}
.field.has-error input { border-color: #e2a5a0; background: #fdf6f5; }
.field.has-error .field-error { display: block; }

/* Buttons */
.btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-height: 52px;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-block { width: 100%; }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--green-300) 0%, var(--green-500) 100%);
    box-shadow: 0 8px 20px rgba(76, 194, 115, 0.32);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(76, 194, 115, 0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { opacity: 0.65; cursor: default; transform: none; box-shadow: none; }
.btn-outline {
    color: var(--green-700);
    background: #fff;
    border-color: var(--sage-200);
}
.btn-outline:hover { background: var(--sage-050); border-color: var(--green-300); }

.alt-action {
    text-align: center;
    font-size: 0.92rem;
    color: var(--ink-500);
    margin-top: 18px;
}
.alt-action a,
.form-message a { color: var(--green-700); font-weight: 600; text-decoration: none; }
.alt-action a:hover { text-decoration: underline; }

.privacy-badge {
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--sage-050);
    border: 1px solid var(--sage-200);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--ink-500);
    text-align: center;
    line-height: 1.5;
}

/* Survey cards */
.survey-card {
    background: var(--sage-050);
    border: 1px solid var(--sage-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}
.survey-card legend,
.survey-card > .survey-label {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: 14px;
    padding: 0;
}
.survey-card { border: 1px solid var(--sage-200); }

/* Radio options */
.radio-grid { display: flex; flex-direction: column; gap: 10px; }
.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--ink-700);
    transition: border-color 0.2s ease, background 0.2s ease;
    min-height: 50px;
}
.radio-option:hover { border-color: var(--green-300); background: var(--sage-050); }
.radio-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--ink-300);
    transition: all 0.2s ease;
    position: relative;
}
.radio-option input:checked ~ .radio-mark {
    border-color: var(--green-500);
}
.radio-option input:checked ~ .radio-mark::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-300), var(--green-500));
}
.radio-option:has(input:checked) {
    border-color: var(--green-500);
    background: var(--sage-100);
}
.radio-option input:focus-visible ~ .radio-mark { box-shadow: var(--focus); }

/* Select */
.select-wrap { position: relative; }
.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    cursor: pointer;
    padding-right: 42px;
}
.select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--ink-500);
    border-bottom: 2px solid var(--ink-500);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

/* Reveal (conditional) fields */
.reveal { margin-top: 12px; animation: fadeUp 0.25s ease; }

/* Searchable combobox */
.combobox { position: relative; }
.combo-input { background-color: #fff; }
.combo-list {
    list-style: none;
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid var(--sage-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 6px;
}
.combo-list li {
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 0.95rem;
    color: var(--ink-700);
    cursor: pointer;
}
.combo-list li:hover,
.combo-list li.is-active {
    background: var(--sage-100);
    color: var(--green-900);
}
.combo-list li.is-empty { color: var(--ink-300); cursor: default; }
.combo-list li.is-empty:hover { background: transparent; }

/* Step 2 navigation */
.step2-nav {
    display: flex;
    gap: 12px;
    margin-top: 26px;
}
.step2-nav .btn-outline { flex: 0 0 34%; }
.step2-nav .btn-primary { flex: 1; }

.form-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: 4px;
    background: #fdf6f5;
    color: #c0392b;
    border: 1px solid #f0d3d0;
}

/* Success */
.success-card { text-align: center; }
.success-mark {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-300), var(--green-500));
    color: #fff;
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 20px;
    box-shadow: 0 10px 24px rgba(76, 194, 115, 0.4);
}
.success-card h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; }
.success-card p { color: var(--ink-500); line-height: 1.6; max-width: 420px; margin: 0 auto 26px; }

/* Accessibility helper */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* Responsive */
@media (max-width: 560px) {
    .signup-shell { padding: 28px 14px 48px; }
    .signup-card { padding: 26px 20px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .step-head h1 { font-size: 1.45rem; }
    .progress-label { display: none; }
    .progress { gap: 8px; }
    .botanical { width: 180px; height: 180px; }
    .step2-nav { flex-direction: column-reverse; }
    .step2-nav .btn-outline { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ===== Top bar with institutional logo ===== */
.site-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(140%) blur(6px);
    border-bottom: 1px solid var(--sage-200);
}
.topbar-logo {
    height: 40px;
    width: auto;
    max-width: 90%;
    object-fit: contain;
}

/* ===== Compact copyright footer ===== */
.site-footer {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 18px 24px 40px;
    text-align: center;
    color: var(--ink-500);
}
.footer-copyright {
    font-weight: 600;
    color: var(--ink-500);
    font-size: 0.8rem;
    margin: 0;
}
.footer-legal-toggle {
    margin-top: 8px;
    font-size: 0.75rem;
}
.footer-legal-toggle > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--green-700);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.footer-legal-toggle > summary::-webkit-details-marker { display: none; }
.footer-legal-toggle > summary::before {
    content: "›";
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.2s ease;
    font-size: 1em;
}
.footer-legal-toggle[open] > summary::before { transform: rotate(-90deg); }
.footer-legal-toggle > summary:hover { background: var(--sage-100); }
.footer-legal-body {
    max-width: 640px;
    margin: 10px auto 0;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--sage-200);
    border-radius: var(--radius-sm);
    text-align: left;
}
.footer-legal-body p {
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--ink-500);
    margin: 0 0 8px;
}
.footer-legal-body p:last-child { margin-bottom: 0; }
.footer-legal-body strong { color: var(--ink-700); }
