/* =============================================================
   FPA Member Support Application - Stylesheet
   Mobile-first, clean and professional
   ============================================================= */

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

html {
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: #f5f0eb;
    color: #2a2a2a;
    line-height: 1.6;
}

/* =============================================================
   LANGUAGE SYSTEM
   body.lang-en  -> show .en, hide .af
   body.lang-af  -> show .af, hide .en
   ============================================================= */

/* Default: hide both until body class is set */
.en, .af { display: none; }

body.lang-en .en { display: inline; }
body.lang-en .af { display: none; }

body.lang-af .af { display: inline; }
body.lang-af .en { display: none; }

/* Block-level language elements */
body.lang-en p.en,
body.lang-en div.en,
body.lang-en h1.en,
body.lang-en h2.en,
body.lang-en label.en,
body.lang-en li.en {
    display: block;
}

body.lang-af p.af,
body.lang-af div.af,
body.lang-af h1.af,
body.lang-af h2.af,
body.lang-af label.af,
body.lang-af li.af {
    display: block;
}

/* =============================================================
   LANGUAGE TOGGLE BAR
   ============================================================= */
.lang-toggle-bar {
    background: #8B2500;
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.85rem;
}

.lang-toggle-bar .en,
.lang-toggle-bar .af {
    color: rgba(255,255,255,0.8);
    margin-right: 4px;
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: rgba(255,255,255,0.85);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.lang-btn.active {
    background: #fff;
    color: #8B2500;
    border-color: #fff;
    font-weight: bold;
}

/* =============================================================
   CONTAINER
   ============================================================= */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* =============================================================
   LOGO
   ============================================================= */
.logo-wrap {
    text-align: center;
    padding: 20px 0 8px;
}

.logo {
    max-height: 80px;
    width: auto;
    display: inline-block;
}

/* =============================================================
   PAGE TITLE
   ============================================================= */
h1 {
    text-align: center;
    color: #8B2500;
    font-size: 1.5rem;
    margin: 8px 0 16px;
    font-weight: 700;
}

/* =============================================================
   INTRODUCTION BOX
   ============================================================= */
.intro-box {
    background: #FFF8F0;
    border: 1px solid #d4a87a;
    border-left: 4px solid #8B2500;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.intro-box p {
    margin: 0;
    font-size: 0.95rem;
    color: #3a2a1a;
}

/* =============================================================
   FORM SECTIONS
   ============================================================= */
.form-section {
    background: #FFF8F0;
    border: 1px solid #ddd0c0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.section-header {
    background: #8B2500;
    padding: 10px 16px;
}

.section-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.section-body {
    padding: 16px;
}

/* =============================================================
   FIELD LAYOUTS
   ============================================================= */
.field-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

@media (min-width: 560px) {
    .field-row.two-col {
        flex-direction: row;
    }
    .field-row.two-col .field-group {
        flex: 1;
        min-width: 0;
    }
    .field-row.three-col {
        flex-direction: row;
    }
    .field-row.three-col .field-group {
        flex: 1;
        min-width: 0;
    }
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* =============================================================
   LABELS & INPUTS
   ============================================================= */
label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3a2a1a;
    display: block;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #c0b0a0;
    border-radius: 5px;
    font-size: 0.95rem;
    background: #fff;
    color: #2a2a2a;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #8B2500;
    box-shadow: 0 0 0 3px rgba(139,37,0,0.12);
    outline: none;
}

input.input-error,
textarea.input-error,
select.input-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.num-input {
    max-width: 140px;
}

input[type="file"] {
    padding: 6px 8px;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Required asterisk */
.req {
    color: #c0392b;
    font-weight: bold;
    margin-left: 2px;
}

/* Hint text */
.hint {
    font-size: 0.78rem;
    color: #777;
    font-style: italic;
    display: block;
}

/* Field error message */
.field-error {
    font-size: 0.8rem;
    color: #c0392b;
    font-weight: 500;
    min-height: 1em;
    display: block;
}

/* =============================================================
   EQUIPMENT GRID
   ============================================================= */
.equipment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (min-width: 560px) {
    .equipment-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.equip-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.equip-item label {
    font-size: 0.82rem;
}

.equip-num {
    max-width: 80px !important;
    width: 80px !important;
    text-align: center;
}

/* =============================================================
   CHECKBOX LIST
   ============================================================= */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: normal;
    color: #2a2a2a;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.checkbox-label:hover {
    background: #f5e8d8;
    border-color: #d4a87a;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: #8B2500;
}

.checkmark-wrap {
    line-height: 1.4;
}

/* =============================================================
   REPAIRS SUBSECTION
   ============================================================= */
.repairs-subsection {
    margin-top: 8px;
    padding: 16px;
    border-left: 4px solid #8B2500;
    background: #fff5ec;
    border-radius: 0 6px 6px 0;
}

.repair-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.875rem;
    color: #5a4000;
}

.repair-note p {
    margin: 0;
}

/* =============================================================
   SIGNATURE PAD
   ============================================================= */
.sig-instruction {
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.sig-container {
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    line-height: 0;
}

.signature-pad {
    width: 100%;
    height: 200px;
    display: block;
    touch-action: none;
    cursor: crosshair;
}

.sig-actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =============================================================
   BUTTONS
   ============================================================= */
.btn-submit {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #2E7D32;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.03em;
}

.btn-submit:hover {
    background: #1b5e20;
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: transparent;
    color: #555;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background: #f0e8e0;
    border-color: #8B2500;
    color: #8B2500;
}

@media (min-width: 560px) {
    .btn-submit {
        max-width: 320px;
        margin: 0 auto;
        display: block;
    }
}

.submit-row {
    padding: 8px 0 32px;
    display: flex;
    justify-content: center;
}

/* =============================================================
   ERROR PAGE
   ============================================================= */
.error-page {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    padding: 28px 32px;
}

.error-page h1 {
    color: #c0392b;
    margin-top: 0;
    text-align: left;
    font-size: 1.4rem;
}

.error-page ul {
    padding-left: 20px;
    margin: 12px 0;
}

.error-page li {
    margin-bottom: 6px;
    color: #5a1a1a;
}

.btn-back {
    display: inline-block;
    margin-top: 16px;
    padding: 9px 20px;
    background: #8B2500;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-back:hover {
    background: #6a1b00;
}

/* =============================================================
   UTILITY
   ============================================================= */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
