/* ============================================================================
   GHS Customer Portal — glassmorphism design system
   Mirrors the employee sign-in look (public/login.php) on the brand palette so
   the customer-facing prescreen flow (index.php + questionnaire.php) feels like
   one continuous, polished product. Dark navy scene, glass panels, serif display.
   ============================================================================ */

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

:root {
    --brand:       #1450AA;
    --brand-dark:  #0d3d7a;
    --brand-deep:  #082654;
    --brand-light: #3b7bd9;

    --accent-sky:  #38bdf8;
    --accent-glow: #60a5fa;

    --glass-bg:        rgba(255, 255, 255, 0.06);
    --glass-bg-soft:   rgba(255, 255, 255, 0.04);
    --glass-bg-hi:     rgba(255, 255, 255, 0.10);
    --glass-border:    rgba(255, 255, 255, 0.14);
    --glass-border-hi: rgba(255, 255, 255, 0.22);
    --glass-shadow:    0 30px 80px -12px rgba(0, 0, 0, 0.55),
                       0 12px 30px -10px rgba(0, 0, 0, 0.40),
                       inset 0 1px 0 0 rgba(255, 255, 255, 0.10);

    --text:       #ffffff;
    --text-soft:  rgba(255, 255, 255, 0.78);
    --text-mute:  rgba(255, 255, 255, 0.55);
    --text-faint: rgba(255, 255, 255, 0.40);

    --error-bg:   rgba(244, 63, 94, 0.12);
    --error-bord: rgba(244, 63, 94, 0.35);
    --error-text: #fda4af;

    --info-bg:    rgba(56, 189, 248, 0.10);
    --info-bord:  rgba(56, 189, 248, 0.32);
    --info-text:  #bae6fd;

    --ok-bg:      rgba(52, 211, 153, 0.10);
    --ok-bord:    rgba(52, 211, 153, 0.32);
    --ok-text:    #6ee7b7;

    --warn-bg:    rgba(251, 191, 36, 0.10);
    --warn-bord:  rgba(251, 191, 36, 0.32);
    --warn-text:  #fcd34d;

    --serif: 'Instrument Serif', 'Georgia', serif;
    --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { min-height: 100%; }

body {
    font-family: var(--sans);
    color: var(--text);
    background: #050e22;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* ---------- Background scene ---------- */

.scene {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 70% at 20% 0%, #102a5c 0%, transparent 55%),
        radial-gradient(ellipse 80% 80% at 100% 100%, #0d3d7a 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 60%, #082654 0%, transparent 70%),
        linear-gradient(180deg, #050e22 0%, #07142e 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
    mix-blend-mode: screen;
}
.orb.o1 { width: 560px; height: 560px; top: -140px; left: -140px;
    background: radial-gradient(circle, var(--brand) 0%, transparent 70%); opacity: 0.70; animation: drift1 22s ease-in-out infinite; }
.orb.o2 { width: 500px; height: 500px; top: 30%; right: -120px;
    background: radial-gradient(circle, var(--brand-light) 0%, transparent 70%); opacity: 0.55; animation: drift2 26s ease-in-out infinite; }
.orb.o3 { width: 420px; height: 420px; bottom: -120px; left: 25%;
    background: radial-gradient(circle, var(--accent-sky) 0%, transparent 70%); opacity: 0.35; animation: drift3 30s ease-in-out infinite; }
.orb.o4 { width: 300px; height: 300px; top: 12%; right: 30%;
    background: radial-gradient(circle, #6ea8ff 0%, transparent 70%); opacity: 0.28; animation: drift4 34s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(70px, 90px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-90px, -50px); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(50px, -70px); } }
@keyframes drift4 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-40px, 60px); } }

.grain {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blueprint {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at center, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 10%, transparent 70%);
}

.watermark {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -52%);
    font-family: var(--serif); font-style: italic; font-weight: 400;
    font-size: clamp(260px, 42vw, 620px); line-height: 0.85; letter-spacing: -0.045em;
    background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(56,189,248,0.025) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    z-index: -1; pointer-events: none; white-space: nowrap; user-select: none;
}

/* ---------- Layout ---------- */

.stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}
.stage--top { align-items: flex-start; padding-top: 48px; padding-bottom: 64px; }

.shell { width: 100%; max-width: 460px; }
.shell--wide { max-width: 760px; }

/* ---------- Glass panel ---------- */

.glass {
    position: relative;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(170%);
    -webkit-backdrop-filter: blur(32px) saturate(170%);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--glass-shadow);
    isolation: isolate;
}
.glass--pad { padding: 36px 40px 32px; }
.glass--rise { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

@keyframes rise {
    from { opacity: 0; transform: translateY(18px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Specular edge */
.glass::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.40) 0%, rgba(255,255,255,0.06) 30%,
        rgba(255,255,255,0) 60%, rgba(255,255,255,0.10) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none; z-index: 2;
}
/* Inner aurora wash */
.glass::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background:
        radial-gradient(ellipse 70% 40% at 50% 0%, rgba(20,80,170,0.30) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 30% 100%, rgba(56,189,248,0.10) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
}
.glass > * { position: relative; z-index: 1; }

/* Corner bracket marks */
.corner {
    position: absolute; width: 14px; height: 14px;
    border: 1px solid rgba(255,255,255,0.28); z-index: 3; pointer-events: none;
}
.corner.tl { top: 14px; left: 14px;  border-right: 0; border-bottom: 0; }
.corner.tr { top: 14px; right: 14px; border-left: 0;  border-bottom: 0; }
.corner.bl { bottom: 14px; left: 14px;  border-right: 0; border-top: 0; }
.corner.br { bottom: 14px; right: 14px; border-left: 0;  border-top: 0; }

/* Layered shadow cards behind (login parity) */
.stack { position: relative; }
.stack-layer {
    position: absolute; inset: 0; border-radius: 28px;
    background: var(--glass-bg-soft); border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 18px 50px -10px rgba(0,0,0,0.45); pointer-events: none;
}
.stack-layer.l1 { transform: translate(14px, 18px) rotate(1.5deg) scale(0.985); opacity: 0.55; z-index: -2; }
.stack-layer.l2 { transform: translate(-12px, 10px) rotate(-1.2deg) scale(0.97); opacity: 0.40; z-index: -3; }

/* ---------- Card head ---------- */

.card-strip {
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--text-mute); margin-bottom: 28px;
}
.card-mark { display: inline-flex; align-items: center; gap: 10px; }
.card-mark .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent-sky);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.18), 0 0 14px rgba(56,189,248,0.75);
    animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 3px rgba(56,189,248,0.18), 0 0 14px rgba(56,189,248,0.75); }
    50%     { box-shadow: 0 0 0 8px rgba(56,189,248,0.02), 0 0 22px rgba(56,189,248,0.95); }
}
.card-meta { font-variant-numeric: tabular-nums; color: var(--text-faint); }

.card-logo { display: flex; align-items: center; margin-bottom: 26px; }
.card-logo img {
    max-width: 160px; max-height: 52px; height: auto;
    filter: drop-shadow(0 4px 18px rgba(20,80,170,0.35));
}

.card-header { margin-bottom: 26px; }
.card-eyebrow {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.20em;
    text-transform: uppercase; color: var(--text-mute); margin-bottom: 14px;
    display: flex; align-items: center; gap: 10px;
}
.card-eyebrow::before { content: ''; width: 24px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-sky)); }

.card-title {
    font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.05;
    letter-spacing: -0.02em; color: var(--text); margin-bottom: 10px;
}
.card-title em {
    font-style: italic;
    background: linear-gradient(110deg, var(--accent-sky), var(--brand-light));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card-sub { font-size: 14px; color: var(--text-soft); line-height: 1.55; }

.ornament { display: flex; align-items: center; gap: 14px; margin: 22px 0 4px; }
.ornament::before, .ornament::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.ornament .glyph {
    font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--accent-sky);
    line-height: 1; text-shadow: 0 0 14px rgba(56,189,248,0.55);
}

/* ---------- Section heading inside panels ---------- */
.sect-title {
    font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.1;
    color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em;
}
.sect-hint { font-size: 13px; color: var(--text-mute); margin-bottom: 18px; line-height: 1.5; }

/* ---------- Alerts ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 12px;
    border-radius: 14px; padding: 12px 14px; margin-bottom: 20px;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    background: var(--info-bg); border: 1px solid var(--info-bord);
    font-size: 13px; color: var(--info-text); line-height: 1.5;
}
.alert i { font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.alert .label {
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
    text-transform: uppercase; display: block; margin-bottom: 2px; opacity: 0.75;
}
.alert--error { background: var(--error-bg); border-color: var(--error-bord); color: var(--error-text); animation: shake 0.45s ease-in-out; }
.alert--ok    { background: var(--ok-bg);    border-color: var(--ok-bord);    color: var(--ok-text); }
.alert--warn  { background: var(--warn-bg);  border-color: var(--warn-bord);  color: var(--warn-text); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; gap: 12px; }
.field-label {
    font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--text-soft); display: inline-flex; align-items: center; gap: 8px;
}
.field-label .num { color: var(--text-faint); }
.field-label .req { color: var(--error-text); }
.field-hint { font-size: 12px; color: var(--text-mute); margin-top: 7px; line-height: 1.5; }

.input {
    position: relative; background: var(--glass-bg-soft); border: 1px solid var(--glass-border);
    border-radius: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.input::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 50%); pointer-events: none;
}
.input:hover { border-color: var(--glass-border-hi); background: var(--glass-bg); }
.input:focus-within {
    border-color: rgba(56,189,248,0.55); background: var(--glass-bg);
    box-shadow: 0 0 0 4px rgba(20,80,170,0.18), 0 8px 28px -10px rgba(20,80,170,0.45);
}
.input input, .input select, .input textarea {
    width: 100%; padding: 15px 16px; font-family: var(--sans); font-size: 15px; font-weight: 500;
    color: var(--text); background: transparent; border: 0; outline: none; border-radius: inherit;
    position: relative; z-index: 1;
}
.input input.pad-r { padding-right: 48px; }
.input textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.input input::placeholder, .input textarea::placeholder { color: var(--text-faint); font-weight: 400; }
.input select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 44px; }
.input select option { background: #0b1b3a; color: var(--text); }
.input.is-select::after {
    content: ''; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px;
    border-right: 1.5px solid var(--text-mute); border-bottom: 1.5px solid var(--text-mute);
    transform: translateY(-65%) rotate(45deg); pointer-events: none; z-index: 1;
}
.input input:-webkit-autofill, .input input:-webkit-autofill:hover, .input input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0px 1000px transparent inset;
    transition: background-color 5000s ease-in-out 0s; caret-color: var(--text);
}

.field-icon-btn {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--text-mute); cursor: pointer; padding: 8px;
    font-size: 14px; border-radius: 8px; transition: color 0.2s ease, background 0.2s ease; z-index: 2;
}
.field-icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* Choice lists (radio / checkbox) */
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.choice {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    padding: 12px 14px; border-radius: 12px;
    background: var(--glass-bg-soft); border: 1px solid var(--glass-border);
    transition: border-color 0.2s ease, background 0.2s ease;
    font-size: 14px; color: var(--text-soft);
}
.choice:hover { border-color: var(--glass-border-hi); background: var(--glass-bg); color: var(--text); }
.choice input { accent-color: var(--accent-sky); width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.choice:has(input:checked) { border-color: rgba(56,189,248,0.55); background: rgba(56,189,248,0.08); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    padding: 15px 22px; font-family: var(--sans); font-size: 13px; font-weight: 600;
    letter-spacing: 0.10em; text-transform: uppercase; border-radius: 14px; cursor: pointer;
    text-decoration: none; border: 1px solid var(--glass-border); color: var(--text);
    background: var(--glass-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, filter 0.3s ease;
}
.btn:hover { border-color: var(--glass-border-hi); background: var(--glass-bg-hi); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; }

.btn-primary {
    color: #fff; border: 1px solid rgba(255,255,255,0.18);
    background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 55%, var(--brand-dark) 100%);
    position: relative; overflow: hidden;
    box-shadow: 0 12px 32px -8px rgba(20,80,170,0.60), inset 0 1px 0 0 rgba(255,255,255,0.22);
}
.btn-primary::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.28) 50%, transparent 65%);
    transform: translateX(-110%); transition: transform 0.8s ease;
}
.btn-primary:hover {
    transform: translateY(-1px); filter: brightness(1.08);
    box-shadow: 0 18px 40px -10px rgba(20,80,170,0.75), 0 0 0 1px rgba(56,189,248,0.35), inset 0 1px 0 0 rgba(255,255,255,0.30);
}
.btn-primary:hover::before { transform: translateX(110%); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.98); }
.btn .arrow { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; transition: transform 0.3s ease; }
.btn-primary:hover .arrow { transform: translateX(4px); }

.btn-warn { color: #fff8e6; border-color: var(--warn-bord); background: var(--warn-bg); }
.btn-warn:hover { background: rgba(251,191,36,0.18); border-color: rgba(251,191,36,0.5); }

/* Spinner for submit loading state */
.spin {
    width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer strip ---------- */
.card-foot {
    margin-top: 26px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
}
.card-foot .crt { display: inline-flex; align-items: center; gap: 8px; color: var(--text-mute); }
.card-foot .crt::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34d399;
    box-shadow: 0 0 0 3px rgba(52,211,153,0.18), 0 0 12px rgba(52,211,153,0.6);
}
.card-foot .stamp { display: inline-flex; align-items: center; gap: 6px; }
.card-foot .stamp i { color: var(--accent-sky); font-size: 9px; }
.help-line { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-mute); line-height: 1.6; }
.help-line strong { color: var(--text-soft); }

/* ---------- Progress steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.step {
    position: relative; padding: 14px 12px; border-radius: 14px; text-align: center;
    background: var(--glass-bg-soft); border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: var(--text-mute); transition: border-color 0.3s ease, background 0.3s ease;
}
.step .step-ico { font-size: 20px; line-height: 1; margin-bottom: 8px; display: block; }
.step .step-name { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.step.is-done { color: var(--ok-text); border-color: var(--ok-bord); background: var(--ok-bg); }
.step.is-active { color: var(--text); border-color: rgba(56,189,248,0.55); background: rgba(56,189,248,0.10);
    box-shadow: 0 8px 28px -12px rgba(56,189,248,0.5); }

/* ---------- Meta strip (account / order info) ---------- */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
    background: var(--glass-border); border-radius: 16px; overflow: hidden; margin-bottom: 24px; }
.meta-cell { padding: 16px 18px; background: rgba(8, 22, 48, 0.55); }
.meta-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 6px; }
.meta-v { font-size: 15px; font-weight: 600; color: var(--text); word-break: break-word; }

/* ---------- Panels (questionnaire sections) ---------- */
.panel { margin-bottom: 18px; padding: 26px 28px; }
.panel-stagger { animation: rise 0.6s cubic-bezier(0.2,0.8,0.2,1) both; }

/* ---------- Image previews ---------- */
.dropzone {
    border: 1px dashed var(--glass-border-hi); border-radius: 16px; padding: 22px;
    background: var(--glass-bg-soft); transition: border-color 0.25s ease, background 0.25s ease;
}
.dropzone:hover { border-color: rgba(56,189,248,0.45); background: var(--glass-bg); }
.preview-container { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.preview-item { position: relative; }
.file-preview { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; border: 1px solid var(--glass-border-hi); }
.remove-image {
    position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
    background: var(--error-text); color: #4c0519; border: 2px solid #0b1b3a; cursor: pointer;
    font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
}

/* ---------- Modals (glass) ---------- */
.modal-scrim {
    display: none; position: fixed; inset: 0; z-index: 1050;
    align-items: flex-start; justify-content: center;
    background: rgba(3, 8, 22, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 24px; overflow-y: auto;
}
/* JS toggles inline display:flex / none; this class is an optional hook. */
.modal-scrim.is-open { display: flex; }
.modal-card {
    position: relative; width: 100%; max-width: 640px; margin: 4vh auto;
    padding: 30px 32px; background: rgba(10, 22, 46, 0.85);
    backdrop-filter: blur(32px) saturate(170%); -webkit-backdrop-filter: blur(32px) saturate(170%);
    border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: var(--glass-shadow);
    animation: rise 0.35s ease-out both;
}
.modal-card.wide { max-width: 820px; }
.modal-close {
    position: absolute; right: 16px; top: 14px; background: none; border: 0; color: var(--text-mute);
    font-size: 26px; line-height: 1; cursor: pointer; padding: 6px 10px; border-radius: 8px; transition: color 0.2s, background 0.2s;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.modal-head { text-align: center; margin-bottom: 20px; }
.modal-head h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--text); }
.modal-head p { font-size: 13px; color: var(--text-mute); margin-top: 6px; line-height: 1.5; }
.note-box { border-radius: 14px; padding: 16px 18px; margin: 18px 0; font-size: 13.5px; line-height: 1.6;
    background: var(--info-bg); border: 1px solid var(--info-bord); color: var(--info-text); }
.note-box.note-warn { background: var(--warn-bg); border-color: var(--warn-bord); color: var(--warn-text); text-align: center; }
.note-box ul { margin: 8px 0 0 18px; }
.note-box li { margin: 4px 0; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* Help icon next to labels */
.help-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
    background: rgba(56,189,248,0.18); color: var(--accent-sky); border: 1px solid rgba(56,189,248,0.4);
    border-radius: 50%; font-size: 11px; cursor: pointer; flex-shrink: 0; transition: background 0.2s, transform 0.2s;
}
.help-icon:hover { background: rgba(56,189,248,0.32); transform: scale(1.08); }

/* Diagram modal internals */
.diagram-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.diagram-tab {
    padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 12px;
    background: var(--glass-bg-soft); border: 1px solid var(--glass-border); color: var(--text-soft); transition: all 0.25s;
}
.diagram-tab:hover { background: var(--glass-bg); }
.diagram-tab.active { background: rgba(56,189,248,0.14); border-color: rgba(56,189,248,0.5); color: var(--text); }
.diagram-container { background: rgba(255,255,255,0.96); border-radius: 16px; padding: 20px; }
#applianceDiagram { width: 100%; min-height: 280px; margin-bottom: 16px; }
#applianceDiagram svg { width: 100%; height: auto; max-height: 400px; }
.tag-location { fill: #ff4757; stroke: #ff3742; stroke-width: 2; }
.appliance-body { fill: #d7dde6; stroke: #94a3b8; stroke-width: 2; }
.tag-label { font-family: Arial, sans-serif; font-size: 12px; font-weight: bold; fill: #1f2d4a; }
.arrow { stroke: #e74c3c; stroke-width: 2; fill: none; marker-end: url(#arrowhead); }
.location-info { padding: 16px 4px 0; }
.location-info h5 { font-size: 14px; color: var(--text-soft); margin-bottom: 10px; font-weight: 600; }
.location-list { list-style: none; }
.location-list li { padding: 6px 0; display: flex; align-items: center; color: var(--text-soft); font-size: 14px; }
.location-list li::before { content: "→"; margin-right: 10px; color: var(--accent-sky); font-weight: bold; }

/* ---------- Utilities ---------- */
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.mt-auto { margin-top: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .stage { padding: 16px; }
    .glass--pad { padding: 26px 20px 22px; }
    .panel { padding: 22px 18px; }
    .card-title { font-size: 34px; }
    .stack-layer { display: none; }
    .steps { gap: 8px; }
    .step { padding: 12px 8px; }
    .watermark { font-size: 50vw; }
    .orb { filter: blur(70px); }
    .corner { width: 11px; height: 11px; }
    .modal-card { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .orb { animation: none !important; }
}
