/**
 * Actuators.cn — RFQ form v3 "Spec Sheet" theme
 *
 * Concept: the page reads like a printed enquiry specification sheet —
 * a single continuous sheet with numbered sections separated by perforation
 * rules, engineering blue accents, mono section codes. Form markup, field
 * names and JS behaviour are untouched; this file only changes display.
 *
 * Fonts: Saira Semi Condensed (display) / Inter (body) / JetBrains Mono (codes)
 */

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

:root {
    --ink: #16222e;          /* near-black blue ink */
    --ink-soft: #45566a;
    --ink-mute: #7b8a9a;
    --paper: #e9edf1;        /* desk surface */
    --sheet: #ffffff;        /* the spec sheet */
    --line: #d3dae1;
    --line-soft: #e4e9ee;
    --brand: #1a56db;        /* site brand blue */
    --brand-deep: #10306f;
    --blueprint: #2c4f86;    /* section code blue */
    --signal: #e8720c;       /* industrial orange — required marks & focus only */
    --field-bg: #fbfcfd;
    --ok: #0c7a4d;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.6 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ============ Top bar: deep ink strip ============ */
.cp-topnav {
    background: var(--brand-deep);
    border-bottom: 3px solid var(--brand);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1.4rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.cp-topnav a { color: #cfe0ff; text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.cp-topnav a:hover { color: #fff; text-decoration: underline; }
.cp-topnav a.cp-topnav-brand,
.cp-topnav > a:first-child {
    color: #fff;
    font: 700 1.05rem 'Saira Semi Condensed', 'Inter', sans-serif;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.cp-topnav a[href*="register"],
.cp-topnav a[href*="register.php"] {
    background: var(--brand);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 3px;
    font-weight: 600;
}
.cp-topnav a[href*="register"]:hover { background: #2f6ae8; text-decoration: none; }
.cp-topnav span { color: #9fb6dd; font-size: 0.85rem; }

/* ============ Page sheet ============ */
.cp-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 2.2rem 1.4rem 4rem;
}

/* Masthead: title block like the header of a printed spec sheet */
.cp-header {
    border-bottom: 2px solid var(--ink);
    padding: 0 0 1.4rem;
    margin-bottom: 1.8rem;
    position: relative;
}
.cp-header::before {
    content: "RFQ";
    position: absolute;
    right: 0;
    top: -0.2rem;
    font: 500 0.78rem/1 'JetBrains Mono', monospace;
    color: var(--ink-mute);
    letter-spacing: 0.14em;
    border: 1px solid var(--line);
    padding: 0.35rem 0.6rem;
    background: var(--sheet);
}
.cp-header h1 {
    margin: 0 0 0.5rem;
    font: 700 clamp(1.9rem, 4.5vw, 2.7rem)/1.1 'Saira Semi Condensed', 'Inter', sans-serif;
    color: var(--ink);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.cp-header .cp-subtitle {
    margin: 0;
    max-width: 62ch;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* ============ The sheet: form ============ */
.cp-form {
    background: var(--sheet);
    border: 1px solid var(--line);
    border-top: 4px solid var(--brand);
    box-shadow: 0 1px 2px rgba(22, 34, 46, 0.05), 0 12px 32px -18px rgba(22, 34, 46, 0.25);
    padding: 0.2rem 2rem 2rem;
}

/* Sections separated like a perforated form */
.cp-section {
    border: none;
    border-top: 1px dashed var(--line);
    margin: 0 -2rem;
    padding: 1.6rem 2rem 0.4rem;
    position: relative;
}
.cp-section:first-of-type { border-top: none; margin-top: 0; padding-top: 1.2rem; }

.cp-section legend {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    padding: 0 0 1rem;
    margin: 0;
    width: auto;
    font: 600 1.15rem 'Saira Semi Condensed', 'Inter', sans-serif;
    color: var(--ink);
    letter-spacing: 0.01em;
}
/* hide emoji icons, show mono section codes instead */
.cp-section-icon { display: none; }
.cp-section legend::before {
    counter-increment: sheetsec;
    content: counter(sheetsec, decimal-leading-zero);
    font: 500 0.82rem 'JetBrains Mono', monospace;
    color: #fff;
    background: var(--blueprint);
    padding: 0.22rem 0.5rem 0.18rem;
    transform: translateY(-0.1rem);
}
.cp-form { counter-reset: sheetsec; }

/* ============ Rows / columns ============ */
.cp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.4rem;
    margin-bottom: 1.1rem;
}
.cp-col { flex: 1 1 100%; min-width: 0; }
.cp-col-2 { flex: 1 1 calc(50% - 0.7rem); }
.cp-col-3 { flex: 1 1 calc(33.33% - 0.94rem); }

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}
.cp-required::after,
label.cp-required::after { content: " *"; color: var(--signal); font-weight: 700; }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background: var(--field-bg);
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--ink);
    font: 400 0.95rem/1.45 'Inter', sans-serif;
    padding: 0.6rem 0.7rem;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.13);
}
input::placeholder, textarea::placeholder { color: #9aa8b5; }
select { appearance: auto; }

.cp-hint { display: block; font-size: 0.78rem; color: var(--ink-mute); margin-top: 0.3rem; }
.cp-error {
    display: none;
    color: #c02a2a;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}
.cp-error.show, .cp-error[data-show] { display: block; }

/* ============ Dynamic spec groups ============ */
.cp-specs-group,
#specs-dampers, #specs-valves, #mating-valve, #valve-specs {
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--blueprint);
    background: #f7f9fb;
    border-radius: 2px;
    padding: 1rem 1.2rem 0.2rem;
    margin: 0.4rem 0 1.4rem;
}
.cp-specs-group h4, #specs-dampers h4, #mating-valve h4, #valve-specs h4 {
    margin: 0 0 0.9rem;
    font: 600 0.95rem 'Saira Semi Condensed', 'Inter', sans-serif;
    color: var(--blueprint);
    letter-spacing: 0.02em;
}
.cp-specs-group .cp-row, #specs-dampers .cp-row, #mating-valve .cp-row, #valve-specs .cp-row { margin-bottom: 0.9rem; }

/* ============ Upload zone ============ */
.rfq-upload-area { margin-bottom: 0.5rem; }
.cp-upload-zone {
    border: 2px dashed var(--line);
    background: var(--field-bg);
    border-radius: 3px;
    text-align: center;
    padding: 1.6rem 1rem;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}
.cp-upload-zone:hover, .cp-upload-zone.dragover {
    border-color: var(--brand);
    background: rgba(26, 86, 219, 0.04);
}
.cp-upload-zone p { margin: 0 0 0.4rem; color: var(--ink-soft); font-weight: 500; }
.cp-upload-hint { font-size: 0.78rem; color: var(--ink-mute); font-weight: 400 !important; }
.cp-file-list { margin-top: 0.6rem; }
.cp-file-list .cp-file-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font: 400 0.82rem 'JetBrains Mono', monospace;
    color: var(--ink-soft);
    background: var(--field-bg);
    border: 1px solid var(--line-soft);
    border-radius: 2px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.35rem;
}

/* ============ Buttons ============ */
.cp-btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 3px;
    font: 600 0.95rem 'Inter', sans-serif;
    padding: 0.65rem 1.4rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.cp-btn-primary { background: var(--brand); color: #fff; }
.cp-btn-primary:hover { background: #2f6ae8; box-shadow: 0 3px 10px -3px rgba(26, 86, 219, 0.5); }
.cp-btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.cp-btn-outline:hover { background: rgba(26, 86, 219, 0.06); }
.cp-btn-lg { font-size: 1.05rem; padding: 0.85rem 2.2rem; }
.cp-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.cp-form-actions {
    border-top: 2px solid var(--ink);
    margin: 1.6rem -2rem 0;
    padding: 1.6rem 2rem 0.4rem;
    text-align: center;
}
.cp-form-actions .cp-btn-primary {
    min-width: 300px;
    font: 700 1.1rem 'Saira Semi Condensed', 'Inter', sans-serif;
    letter-spacing: 0.02em;
}
.cp-alt-contact { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--ink-mute); }
.cp-alt-contact a { color: var(--brand); text-decoration: none; font-weight: 500; }
.cp-alt-contact a:hover { text-decoration: underline; }

/* ============ Responsive ============ */
@media (max-width: 720px) {
    .cp-container { padding: 1.4rem 0.9rem 3rem; }
    .cp-form { padding: 0.2rem 1.1rem 1.4rem; }
    .cp-section { margin: 0 -1.1rem; padding: 1.2rem 1.1rem 0.3rem; }
    .cp-col-2, .cp-col-3 { flex-basis: 100%; }
    .cp-form-actions { margin: 1.2rem -1.1rem 0; padding: 1.3rem 1.1rem 0.4rem; }
    .cp-form-actions .cp-btn-primary { min-width: 0; width: 100%; }
    .cp-topnav { padding: 0.55rem 0.9rem; flex-wrap: wrap; }
    .cp-header::before { position: static; display: inline-block; margin-bottom: 0.6rem; }
}

/* focus visibility for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 1px;
}
