/* ============================================
   Hypoteční kalkulačka — Leadcore
   Tmavá tyrkysová paleta, hranatý institucionální styl
   ============================================ */

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

html { scroll-behavior: smooth; }

body {
    --bg: #0c1f24;
    --bg-2: #102a30;
    --panel: #14353d;
    --panel-2: #1a4048;
    --border: #1f4b54;
    --border-strong: #2d6671;
    --text: #e8f0f1;
    --text-dim: #8fa9ad;
    --text-mute: #5a7a80;
    --accent: #ff6b35;
    --accent-dim: #cc4d1f;
    --good: #6dd3a8;
    --warn: #f5c451;

    font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hypo-app {
    padding: 24px 16px 48px;
    position: relative;
    overflow-x: hidden;
}

.hypo-app::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.015) 1px, transparent 0);
    background-size: 4px 4px;
    pointer-events: none;
    z-index: 0;
}

.hypo-container {
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* === Header === */
.hypo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.hypo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hypo-brand-mark {
    width: 36px;
    height: 36px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--bg);
    font-size: 18px;
    flex-shrink: 0;
}

.hypo-brand-text {
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 500;
}

.hypo-brand-text strong {
    color: var(--text);
    font-weight: 600;
}

.hypo-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.05em;
}

/* === Title === */
.hypo-title {
    font-size: clamp(26px, 4vw, 44px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.hypo-title strong {
    font-weight: 600;
    color: var(--accent);
}

.hypo-subtitle {
    color: var(--text-dim);
    font-size: 15px;
    max-width: 620px;
    margin-bottom: 28px;
    line-height: 1.55;
}

/* === Grid === */
.hypo-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 0;
    border: 1px solid var(--border);
    background: var(--panel);
}

.hypo-inputs {
    padding: 28px;
    border-right: 1px solid var(--border);
}

.hypo-output {
    padding: 28px;
    background: var(--bg-2);
    display: flex;
    flex-direction: column;
}

@media (max-width: 880px) {
    .hypo-grid { grid-template-columns: 1fr; }
    .hypo-inputs {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 520px) {
    .hypo-app { padding: 16px 12px 32px; }
    .hypo-inputs, .hypo-output { padding: 20px; }
}

/* === Section labels === */
.hypo-section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hypo-section-label::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    display: inline-block;
}

/* === Fields === */
.hypo-field { margin-bottom: 22px; }

.hypo-field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 12px;
}

.hypo-field-label {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 400;
}

.hypo-field-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    text-align: right;
    white-space: nowrap;
}

.hypo-field-value .unit {
    color: var(--text-mute);
    font-size: 12px;
    margin-left: 4px;
}

/* === Slider === */
.hypo-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border);
    outline: none;
    margin-top: 8px;
    cursor: pointer;
    touch-action: pan-y;
}

.hypo-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    cursor: pointer;
    border: 0;
    border-radius: 0;
    transition: transform 0.1s;
}

.hypo-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.hypo-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    cursor: pointer;
    border: 0;
    border-radius: 0;
}

.hypo-slider:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

@media (pointer: coarse) {
    .hypo-slider { height: 6px; }
    .hypo-slider::-webkit-slider-thumb { width: 24px; height: 24px; }
    .hypo-slider::-moz-range-thumb { width: 24px; height: 24px; }
}

.hypo-slider-marks {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-mute);
    margin-top: 6px;
}

/* === LTV box === */
.hypo-ltv-box {
    margin-top: 28px;
    padding: 16px;
    background: var(--bg-2);
    border-left: 3px solid var(--accent);
}

.hypo-ltv-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 6px;
}

.hypo-ltv-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 500;
    color: var(--good);
    transition: color 0.2s;
}

.hypo-ltv-value.warn {
    color: var(--warn);
}

.hypo-ltv-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* === Result main === */
.hypo-result-main {
    padding: 24px;
    background: var(--panel-2);
    border: 1px solid var(--border-strong);
    margin-bottom: 22px;
    position: relative;
}

.hypo-result-main::before {
    content: '01';
    position: absolute;
    top: 12px;
    right: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.1em;
}

.hypo-result-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.hypo-result-big {
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
    word-break: break-word;
}

.hypo-result-big strong {
    color: var(--accent);
    font-weight: 600;
}

.hypo-result-big .unit {
    font-size: clamp(14px, 1.5vw, 18px);
    color: var(--text-dim);
    margin-left: 8px;
    font-weight: 400;
    white-space: nowrap;
}

/* === Result grid === */
.hypo-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    margin-bottom: 22px;
}

.hypo-result-cell {
    background: var(--panel-2);
    padding: 16px;
}

.hypo-result-cell-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 8px;
}

.hypo-result-cell-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

.hypo-result-cell-value.dim { color: var(--text-dim); }
.hypo-result-cell-value.accent { color: var(--accent); }

@media (max-width: 420px) {
    .hypo-result-grid { grid-template-columns: 1fr; }
}

/* === Locked === */
.hypo-locked {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    background: var(--panel-2);
    border: 1px dashed var(--border-strong);
    text-align: center;
    min-height: 200px;
}

.hypo-locked-icon {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent);
    font-size: 22px;
}

.hypo-locked-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.hypo-locked-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
    max-width: 320px;
    line-height: 1.5;
}

/* === Buttons === */
.hypo-btn {
    font-family: inherit;
    background: var(--accent);
    color: var(--bg);
    border: 0;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    text-decoration: none;
}

.hypo-btn:hover {
    background: var(--accent-dim);
    color: var(--text);
}

.hypo-btn:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.hypo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hypo-btn-block { width: 100%; }

/* === Unlocked === */
.hypo-unlock-banner {
    padding: 12px 16px;
    background: rgba(109, 211, 168, 0.08);
    border-left: 3px solid var(--good);
    margin-bottom: 22px;
    font-size: 13px;
    color: var(--good);
}

.hypo-table-wrap {
    background: var(--panel-2);
    border: 1px solid var(--border);
    padding: 20px;
}

.hypo-table-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.hypo-table-scroll {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hypo-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    min-width: 360px;
}

.hypo-table th {
    text-align: right;
    padding: 8px 12px;
    color: var(--text-mute);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 10px;
    position: sticky;
    top: 0;
    background: var(--panel-2);
}

.hypo-table th:first-child { text-align: left; }

.hypo-table td {
    text-align: right;
    padding: 8px 12px;
    color: var(--text);
    border-bottom: 1px solid rgba(31, 75, 84, 0.4);
}

.hypo-table td:first-child {
    text-align: left;
    color: var(--text-dim);
}

.hypo-table tr:last-child td { border-bottom: 0; }
.hypo-table tr:hover td { background: var(--panel); }

/* === Footer === */
.hypo-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.05em;
    flex-wrap: wrap;
    gap: 12px;
}

.hypo-footer a { color: var(--accent); text-decoration: none; }
.hypo-footer a:hover { text-decoration: underline; }

/* === Modal === */
.hypo-modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 16, 18, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;
}

.hypo-modal[hidden] { display: none; }

.hypo-modal-content {
    background: var(--panel);
    border: 1px solid var(--border-strong);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
    margin: auto;
}

@media (max-width: 520px) {
    .hypo-modal { padding: 0; align-items: flex-start; }
    .hypo-modal-content { padding: 24px 20px; min-height: 100vh; max-width: 100%; }
}

.hypo-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 0;
    color: var(--text-dim);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.hypo-modal-close:hover { color: var(--text); }
.hypo-modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hypo-modal-title {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.hypo-modal-desc {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 22px;
    line-height: 1.55;
}

/* === Form === */
.hypo-form-group { margin-bottom: 14px; }

.hypo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 380px) {
    .hypo-form-row { grid-template-columns: 1fr; gap: 0; }
}

.hypo-form-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 6px;
    display: block;
}

.hypo-form-input {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px;
    font-family: inherit;
    font-size: 16px; /* 16px brání zoomu na iOS */
    outline: none;
    transition: border-color 0.15s;
    border-radius: 0;
}

.hypo-form-input:focus { border-color: var(--accent); }

.hypo-form-input:invalid:not(:placeholder-shown) {
    border-color: var(--warn);
}

.hypo-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.hypo-form-error {
    background: rgba(245, 196, 81, 0.1);
    border-left: 3px solid var(--warn);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--warn);
    margin-bottom: 14px;
    line-height: 1.5;
}

.hypo-form-disclaimer {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 14px;
    line-height: 1.5;
    text-align: center;
}

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