/* ── Speed Unit Converter — style.css ─────────────────────── */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent:       #db2777;
    --accent-dark:  #be185d;
    --accent-light: #fbcfe8;
    --accent-glow:  rgba(219, 39, 119, 0.18);
    --bg:           #fdf8f9;
    --surface:      #ffffff;
    --surface2:     #fcf1f4;
    --border:       #f3d8df;
    --text-primary: #1f080f;
    --text-secondary:#5c3a44;
    --text-muted:   #9c7c86;
    --radius-lg:    16px;
    --radius-md:    10px;
    --radius-sm:    6px;
    --shadow-sm:    0 1px 3px rgba(186,24,93,.06), 0 1px 2px rgba(186,24,93,.04);
    --shadow-md:    0 4px 16px rgba(186,24,93,.08), 0 2px 6px rgba(186,24,93,.05);
    --shadow-lg:    0 8px 32px rgba(186,24,93,.10), 0 2px 8px rgba(186,24,93,.06);
    --transition:   0.18s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 48px;
}

/* ── Header ───────────────────────────────────────────────── */
header {
    padding: 28px 0 20px;
    text-align: left;
}

.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.subtitle {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 680px;
    text-align: left;
}

/* ── Header Actions ────────────────────────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.home-btn:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
    border-color: var(--accent);
}

.lang-switcher {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    letter-spacing: 0.02em;
}
.lang-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
}
.lang-btn.active {
    background: var(--accent);
    border-color: var(--accent-dark);
    color: #ffffff;
}

/* ── Reset Row ────────────────────────────────────────────── */
.reset-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.btn-reset {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}
.btn-reset:hover {
    background: #ffe4e6;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ── Main Grid ────────────────────────────────────────────── */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 768px) {
    .calc-grid { grid-template-columns: 1fr; }
}

/* ── Section Cards ────────────────────────────────────────── */
.calc-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: box-shadow var(--transition);
}
.calc-section:hover {
    box-shadow: var(--shadow-md);
}

.section-header {
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.section-title > span:first-child {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* ── Input Rows ───────────────────────────────────────────── */
.input-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Field Groups ─────────────────────────────────────────── */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.field-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.unit-symbol {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.field-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: textfield;
    -moz-appearance: textfield;
}
.field-group input[type="number"]::-webkit-outer-spin-button,
.field-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}
.field-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-group input[type="number"]::placeholder {
    color: var(--text-muted);
}

/* ── Relations & Info Card ───────────────────────── */
.info-section {
    margin-top: 10px;
}

.relations-card,
.faq-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.relations-card h2,
.faq-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-light);
}

.relations-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.relations-list li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 14px;
    position: relative;
}

.relations-list li::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* ── FAQ Card ─────────────────────────────────────────────── */
.faq-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.faq-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}
footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 6px;
}
footer a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* ── Accent Divider ───────────────────────────────────────── */
.accent-divider {
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 2px;
    margin-bottom: 24px;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .header-actions, .reset-row, footer { display: none; }
    .calc-section { box-shadow: none; border: 1px solid #ccc; }
}
