/* ============================================================
   FLOOR HEATING CALCULATOR — fhc-style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Root / variables ─────────────────────────────────────── */
.fhc-wrap {
    --fhc-bg:         #0b1120;
    --fhc-card:       #111827;
    --fhc-card2:      #151d2e;
    --fhc-border:     rgba(255,255,255,0.07);
    --fhc-text:       #e5ecf6;
    --fhc-muted:      #6b7a99;
    --fhc-red:        #ef4444;
    --fhc-orange:     #f97316;
    --fhc-blue:       #3b82f6;
    --fhc-cyan:       #06b6d4;
    --fhc-green:      #22c55e;
    --fhc-yellow:     #eab308;
    --fhc-input-bg:   #090f1d;
    --fhc-radius:     16px;
    --fhc-radius-sm:  10px;

    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--fhc-bg);
    border-radius: 22px;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    max-width: 980px;
    margin: 2rem auto;
    color: var(--fhc-text);
    box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 0 1px var(--fhc-border);
    position: relative;
    overflow: hidden;
}

/* Background glow decoration */
.fhc-wrap::before,
.fhc-wrap::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}
.fhc-wrap::before {
    top: -150px; left: -100px;
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(239,68,68,0.08) 0%, transparent 65%);
}
.fhc-wrap::after {
    bottom: -100px; right: -80px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(59,130,246,0.07) 0%, transparent 65%);
}

/* ── Header ───────────────────────────────────────────────── */
.fhc-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--fhc-border);
    position: relative;
    z-index: 1;
}
.fhc-header__icon {
    width: 60px; height: 60px;
    flex-shrink: 0;
    color: var(--fhc-red);
    background: rgba(239,68,68,0.12);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    padding: 12px;
    box-shadow: 0 0 0 1px rgba(239,68,68,0.2);
}
.fhc-header__text h2 {
    font-size: clamp(1.2rem, 3vw, 1.65rem);
    font-weight: 800;
    margin: 0 0 .3rem;
    letter-spacing: -.5px;
    line-height: 1.15;
    background: linear-gradient(135deg, #f0f4ff 0%, #a8bde0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.fhc-header__text p {
    margin: 0;
    color: var(--fhc-muted);
    font-size: .9rem;
    font-weight: 400;
}

/* ── Layout grid ──────────────────────────────────────────── */
.fhc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
@media (max-width: 720px) {
    .fhc-layout { grid-template-columns: 1fr; }
}

/* ── Section blocks ───────────────────────────────────────── */
.fhc-section {
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.fhc-section:last-of-type { margin-bottom: 0; }

.fhc-section__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--fhc-muted);
    margin-bottom: 1.15rem;
}
.fhc-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.fhc-dot--red   { background: var(--fhc-red);   box-shadow: 0 0 6px var(--fhc-red); }
.fhc-dot--blue  { background: var(--fhc-blue);  box-shadow: 0 0 6px var(--fhc-blue); }
.fhc-dot--green { background: var(--fhc-green); box-shadow: 0 0 6px var(--fhc-green); }

/* ── Fields ───────────────────────────────────────────────── */
.fhc-field {
    margin-bottom: 1rem;
}
.fhc-field:last-child { margin-bottom: 0; }
.fhc-field--mt { margin-top: .25rem; }

.fhc-label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: var(--fhc-muted);
    margin-bottom: .4rem;
}
.fhc-label-inline {
    font-size: .82rem;
    font-weight: 500;
    color: var(--fhc-muted);
    white-space: nowrap;
}

/* Input */
.fhc-input-wrap {
    display: flex;
    align-items: center;
    background: var(--fhc-input-bg);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-sm);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.fhc-input-wrap:focus-within {
    border-color: var(--fhc-red);
    box-shadow: 0 0 0 3px rgba(239,68,68,.13);
}
.fhc-input-wrap--sm { flex: 1; }

.fhc-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--fhc-text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    padding: .65rem .9rem;
    width: 100%;
    min-width: 0;
    -moz-appearance: textfield;
}
.fhc-input::-webkit-outer-spin-button,
.fhc-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.fhc-unit {
    padding: .65rem .85rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--fhc-muted);
    background: rgba(255,255,255,.03);
    border-left: 1px solid var(--fhc-border);
    white-space: nowrap;
    letter-spacing: .3px;
}

/* Select */
.fhc-select-wrap {
    position: relative;
}
.fhc-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--fhc-input-bg);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-sm);
    color: var(--fhc-text);
    font-family: 'Outfit', sans-serif;
    font-size: .9rem;
    font-weight: 500;
    padding: .65rem 2.5rem .65rem .9rem;
    outline: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
.fhc-select:focus {
    border-color: var(--fhc-red);
    box-shadow: 0 0 0 3px rgba(239,68,68,.13);
}
.fhc-select option { background: #1a2035; }
.fhc-select-arrow {
    position: absolute;
    right: .9rem; top: 50%;
    transform: translateY(-50%);
    color: var(--fhc-muted);
    font-size: .75rem;
    pointer-events: none;
}

/* Hints */
.fhc-hint {
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--fhc-muted);
    line-height: 1.4;
}
.fhc-hint--warn { color: var(--fhc-orange); }

/* Tooltip */
.fhc-tip {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 16px; height: 16px;
    font-size: .65rem; font-weight: 800;
    background: rgba(255,255,255,.07);
    border-radius: 50%;
    cursor: help;
    position: relative;
    color: var(--fhc-muted);
    margin-left: .3rem;
    vertical-align: middle;
    transition: background .2s;
}
.fhc-tip:hover { background: rgba(59,130,246,.2); color: var(--fhc-blue); }
.fhc-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a2035;
    border: 1px solid var(--fhc-border);
    border-radius: 10px;
    padding: .55rem .8rem;
    font-size: .75rem;
    font-weight: 400;
    color: var(--fhc-text);
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    z-index: 9999;
    width: 210px;
    text-align: left;
    white-space: normal;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.fhc-tip:hover::after { opacity: 1; }

/* ── Pipe spacing buttons ─────────────────────────────────── */
.fhc-spacing-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
    margin-bottom: .85rem;
}
@media (max-width: 420px) {
    .fhc-spacing-btns { grid-template-columns: repeat(2, 1fr); }
}
.fhc-space-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    background: var(--fhc-input-bg);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-sm);
    color: var(--fhc-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: .9rem;
    font-weight: 600;
    padding: .55rem .4rem;
    cursor: pointer;
    transition: all .2s;
    line-height: 1.2;
}
.fhc-space-btn small {
    font-family: 'Outfit', sans-serif;
    font-size: .62rem;
    font-weight: 400;
    opacity: .7;
}
.fhc-space-btn:hover {
    border-color: rgba(239,68,68,.4);
    color: var(--fhc-text);
}
.fhc-space-btn--active {
    background: rgba(239,68,68,.12);
    border-color: var(--fhc-red);
    color: var(--fhc-red);
    box-shadow: 0 0 0 1px rgba(239,68,68,.2);
}

.fhc-spacing-custom-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* ── Optional toggle ──────────────────────────────────────── */
.fhc-optional-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--fhc-text);
    font-family: 'Outfit', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color .2s;
}
.fhc-optional-toggle:hover { color: var(--fhc-cyan); }
.fhc-chevron {
    transition: transform .3s;
    flex-shrink: 0;
}
.fhc-chevron--open { transform: rotate(180deg); }

.fhc-optional-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(.4,0,.2,1);
}
.fhc-optional-body--open {
    max-height: 600px;
}

/* ── Calc button ──────────────────────────────────────────── */
.fhc-btn-calc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    padding: .95rem 1.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: var(--fhc-radius);
    cursor: pointer;
    margin-top: 1rem;
    transition: transform .15s, box-shadow .2s, filter .2s;
    box-shadow: 0 6px 24px rgba(239,68,68,.35);
    letter-spacing: .2px;
    position: relative;
    z-index: 1;
}
.fhc-btn-calc:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 30px rgba(239,68,68,.5);
}
.fhc-btn-calc:active { transform: scale(.97); }

/* ── Results column ───────────────────────────────────────── */
.fhc-results-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Hero */
.fhc-result-hero {
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius);
    padding: 1.5rem;
    display: flex;
    align-items: stretch;
    gap: 0;
}
.fhc-result-hero__block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
}
.fhc-result-hero__sep {
    width: 1px;
    background: var(--fhc-border);
    flex-shrink: 0;
    margin: .25rem 0;
}
.fhc-rh-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--fhc-muted);
    margin-bottom: .5rem;
}
.fhc-rh-val-wrap {
    display: flex;
    align-items: baseline;
    gap: .3rem;
}
.fhc-rh-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 600;
    line-height: 1;
    transition: color .4s;
}
.fhc-result-hero__block--power .fhc-rh-val { color: var(--fhc-red); }
.fhc-result-hero__block--pipe  .fhc-rh-val { color: var(--fhc-cyan); }
.fhc-rh-unit {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--fhc-muted);
}
.fhc-rh-sub {
    font-size: .78rem;
    color: var(--fhc-muted);
    margin-top: .3rem;
    min-height: 1.2em;
}

/* Stats grid */
.fhc-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
}
@media (max-width: 480px) { .fhc-stats-grid { grid-template-columns: 1fr; } }

.fhc-stat {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-sm);
    padding: .8rem;
}
.fhc-stat__ico { font-size: 1.1rem; line-height: 1; flex-shrink: 0; margin-top: .05rem; }
.fhc-stat__label { font-size: .7rem; color: var(--fhc-muted); margin-bottom: .2rem; line-height: 1.3; }
.fhc-stat__val   {
    font-family: 'JetBrains Mono', monospace;
    font-size: .9rem;
    font-weight: 600;
    color: var(--fhc-text);
}

/* Separator */
.fhc-sep {
    height: 1px;
    background: var(--fhc-border);
}

/* Breakdown */
.fhc-breakdown-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--fhc-muted);
    margin-bottom: .65rem;
}
.fhc-breakdown { display: flex; flex-direction: column; gap: .4rem; }
.fhc-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: 8px;
    padding: .5rem .85rem;
    font-size: .82rem;
}
.fhc-breakdown-row__name { color: var(--fhc-muted); }
.fhc-breakdown-row__val  {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--fhc-text);
}

/* Info box */
.fhc-info-box {
    background: rgba(59,130,246,.06);
    border: 1px solid rgba(59,130,246,.18);
    border-radius: var(--fhc-radius-sm);
    padding: 1rem;
    font-size: .82rem;
    color: var(--fhc-muted);
    line-height: 1.55;
}
.fhc-info-box p  { margin: 0 0 .5rem; }
.fhc-info-box p:last-child { margin-bottom: 0; }
.fhc-info-box.fhc-info--ok   { background: rgba(34,197,94,.06);  border-color: rgba(34,197,94,.2); }
.fhc-info-box.fhc-info--warn { background: rgba(249,115,22,.06); border-color: rgba(249,115,22,.2); }

/* Warnings */
.fhc-warnings {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.fhc-warning {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    background: rgba(239,68,68,.07);
    border: 1px solid rgba(239,68,68,.25);
    border-radius: var(--fhc-radius-sm);
    padding: .75rem 1rem;
    font-size: .82rem;
    color: var(--fhc-text);
    line-height: 1.5;
    animation: fhcFadeIn .3s ease;
}
.fhc-warning--info {
    background: rgba(234,179,8,.07);
    border-color: rgba(234,179,8,.25);
}
@keyframes fhcFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Footer */
.fhc-footer {
    margin-top: 1.75rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--fhc-border);
    font-size: .75rem;
    color: var(--fhc-muted);
    text-align: center;
    line-height: 1.55;
    position: relative;
    z-index: 1;
}
