/* ── Root scale anchor ─────────────────────────────────────────────────── */
/* Everything inherits from here. 1.5vmin ≈ 14px on a 1080p screen. */
:root {
    --scale: 1.5vmin;
}

body {
    margin: 0;
    min-width: 800px;
    font-size: var(--scale); /* 👈 base font, all rem/em cascade from this */
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: bisque;
}

.frame {
    position: relative;
    aspect-ratio: 16 / 9;
    height: 100vh;
}

.bg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Form box ──────────────────────────────────────────────────────────── */
.form-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(180px, 30%, 480px);
    padding: clamp(8px, 2vmin, 20px);
    background: rgba(0, 0, 0, 0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-radius: clamp(6px, 1.2vmin, 12px);
}

/* ── Form header / language selector ──────────────────────────────────── */
.form-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.6em;
}

#header-message {
    font-size: clamp(8px, 1.8vmin, 20px);
    margin: 0;
}

.lang-select select {
    font-size: inherit;          /* scales with body */
    padding: 0.4em 0.6em;
    border-radius: 0.4em;
}

/* ── Labels ────────────────────────────────────────────────────────────── */
label {
    width: 25%;
    font-size: 1.5em;              /* inherits body → vmin-scaled */
}

#label-male,
#label-female {
    font-size: 1em;              /* was hardcoded 14px — now scales */
}

/* ── Header message ────────────────────────────────────────────────────── */
#header-message {
    font-size: clamp(10px, 1.8vmin, 18px);
    margin-bottom: 1px;
    margin-right: 120px;
}

/* ── Inputs ────────────────────────────────────────────────────────────── */
.input-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.7em;
}

input {
    font-size: 1em;              /* 👈 was missing — inputs don't inherit by default */
    padding: 0.35em;
    border-radius: 0.4em;
    border: rgba(44, 44, 44, 0);
    background-color: rgba(117, 208, 224, 0.822);
    width: clamp(50px, 6vmin, 80px);
    height: clamp(12px, 2vmin, 20px);
    margin-left: 0.6em;
}

.age-group {
    display: flex;
    gap: 0.3em;
    flex: 1;
}

.age-group input {
    width: 100%;
    padding: 0.4em;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
button {
    font-size: 1em;              /* 👈 buttons also don't inherit by default */
    width: clamp(60px, 50%, 200px);
    padding: 0.6em;
    border: none;
    border-radius: 0.5em;
    background-color: #2c2c2c;
    color: white;
    cursor: pointer;
}

#diagnose-btn {
    font-size: 1em;
}

.diagnose-button button {
    margin-top: 1.8em;
    background-color: rgb(235, 188, 94);
}

/* ── Diagnosis output ──────────────────────────────────────────────────── */
.diagnosis-box {
    margin-top: 0.4em;
    padding: 0.4em;
    border-radius: 0.8em;
    font-size: clamp(18px, 1vmin, 22px);
    line-height: 1.5;
    animation: fadeIn 0.4s ease-in-out;
}

/* ── Credits button (fixed) ────────────────────────────────────────────── */
.credits-button {
    position: fixed;
    bottom: 10%;
    right: 30%;
    z-index: 1000;
}

.credits-button button {
    font-size: 1em;
    width: 100%;
    padding: 0.5em 0.9em;
    border-radius: 0.5em;
    background-color: #555;
    color: white;
    border: none;
    cursor: pointer;
}

/* ── Credits page ──────────────────────────────────────────────────────── */
.index-button button {
    display: block;
    margin: 0 auto;
}

.credits-content {
    max-width: 800px;
    margin: auto;
    line-height: 1.6;
    font-size: clamp(13px, 1.5vmin, 16px);
}

.credits-content h2 {
    text-align: center;
}

.references {
    padding-left: 1.4em;
}

.references li {
    margin-bottom: 0.7em;
}

.disclaimer {
    text-align: center;
    margin-top: 1.4em;
    color: #555;
}

/* ── Animation ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}