/* ═══════════════════════════════════════════════════════════════════════════
   HM CONTACT FORM — Frontend Styles
   Exact visual match with the TTM Machine Information form
═══════════════════════════════════════════════════════════════════════════ */

:root {
    --hmcf-primary: #ffc701;
    --hmcf-font:    'Oswald', sans-serif;
    --hmcf-radius:  8px;
}

/* ── Outer wrap ──────────────────────────────────────────────────────────── */
.hmcf-wrap {
    margin: 0 auto;
    font-family: var(--hmcf-font);
    width: 100%;
    box-sizing: border-box;
}

/* ── Heading block — exact match to .ttm-form-heading ───────────────────── */
.hmcf-heading-block {
    margin-bottom: 24px;
}

.hmcf-heading {
    font-family: var(--hmcf-font) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    line-height: 1.2;
    /* No forced color — inherits theme text color exactly as TTM does */
}

.hmcf-subheading {
    font-family: var(--hmcf-font);
    font-size: 14px;
    color: #888888;
    margin: -16px 0 0 !important;
    padding: 0 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Card (matches ttm-add-form) ─────────────────────────────────────────── */
.hmcf-card {
    background: #f9f9f9;
    border-radius: var(--hmcf-radius);
    overflow: hidden;
    border: 2px solid #eeeeee;
}

.hmcf-card__section {
    padding: 28px 32px;
}

/* ── Section title (matches ttm-add-form__section h3) ────────────────────── */
.hmcf-section-title {
    font-family: var(--hmcf-font) !important;
    font-size: 13px !important;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888888 !important;
    margin: 0 0 22px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid var(--hmcf-primary) !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 700 !important;
}

.hmcf-section-title svg {
    stroke: var(--hmcf-primary);
    flex-shrink: 0;
}

/* ── Form rows ───────────────────────────────────────────────────────────── */
.hmcf-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hmcf-row {
    display: flex;
    gap: 14px;
}

.hmcf-row--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── Individual field (matches ttm-add-field) ────────────────────────────── */
.hmcf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.hmcf-field label {
    font-family: var(--hmcf-font) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555555;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Inputs (matches ttm-add-field input/select/textarea) ────────────────── */
.hmcf-field input[type="text"],
.hmcf-field input[type="email"],
.hmcf-field input[type="tel"],
.hmcf-field input[type="number"],
.hmcf-field select,
.hmcf-field textarea {
    padding: 11px 14px;
    border: 2px solid #e0e0e0;
    border-radius: var(--hmcf-radius);
    font-family: var(--hmcf-font);
    font-size: 15px;
    color: #222222;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.hmcf-field input:focus,
.hmcf-field select:focus,
.hmcf-field textarea:focus {
    outline: none;
    border-color: var(--hmcf-primary);
    box-shadow: 0 0 0 3px rgba(255,199,1,0.15);
}

.hmcf-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffc701' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.hmcf-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Checkbox field */
.hmcf-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-size: 14px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
}

.hmcf-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--hmcf-primary);
    flex-shrink: 0;
}

/* Error state */
.hmcf-field input.hmcf-error,
.hmcf-field select.hmcf-error,
.hmcf-field textarea.hmcf-error {
    border-color: #e55555 !important;
    box-shadow: 0 0 0 3px rgba(229,85,85,0.12) !important;
}

/* ── Submit button — exact match to .ttm-submit-btn + .ttm-submit-btn--large */
.hmcf-actions {
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;    /* centred, like TTM actions section */
    gap: 10px;
    text-align: center;
}

.hmcf-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* TTM --large sizing */
    padding: 13px 36px !important;
    min-width: 220px;
    border-radius: 9px !important;
    font-size: 15px !important;
    /* TTM button colours — double declaration + !important beats theme overrides */
    background: var(--hmcf-primary) !important;
    background-color: #ffc701 !important;
    color: #111111 !important;
    border: none !important;
    font-family: var(--hmcf-font) !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    min-height: 52px;
    text-decoration: none !important;
    box-shadow: none !important;
}

.hmcf-submit-btn:hover {
    background: #ffd740 !important;
    background-color: #ffd740 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255,199,1,0.4) !important;
    color: #111111 !important;
}

.hmcf-submit-btn:active {
    transform: translateY(0);
    box-shadow: none !important;
}

.hmcf-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Feedback messages ───────────────────────────────────────────────────── */
.hmcf-feedback {
    font-family: var(--hmcf-font);
    font-size: 14px;
    border-radius: var(--hmcf-radius);
    padding: 0;
    transition: all 0.3s;
}

.hmcf-feedback.hmcf-success {
    background: #eafaf0;
    border: 1px solid #a3d9b5;
    color: #1a7a3f;
    padding: 14px 18px;
    font-weight: 600;
}

.hmcf-feedback.hmcf-error {
    background: #fff0f0;
    border: 1px solid #f5aaaa;
    color: #c0392b;
    padding: 14px 18px;
    font-weight: 600;
}

/* ── Success state: hide form, show message full-width ───────────────────── */
.hmcf-form.hmcf-submitted .hmcf-field,
.hmcf-form.hmcf-submitted .hmcf-row,
.hmcf-form.hmcf-submitted .hmcf-actions {
    display: none !important;
}

.hmcf-form.hmcf-submitted .hmcf-feedback {
    font-size: 16px;
    padding: 20px 24px;
}

/* ── Entrance animation ──────────────────────────────────────────────────── */
@keyframes hmcf-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hmcf-wrap {
    animation: hmcf-fade-in 0.4s ease both;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════════════════════════════════════ */

@media ( max-width: 640px ) {
    .hmcf-card__section {
        padding: 20px 16px;
    }

    .hmcf-heading {
        font-size: 22px !important;
        letter-spacing: 1px;
    }

    .hmcf-subheading {
        font-size: 14px;
    }

    /* Stack half-width rows */
    .hmcf-row--half {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .hmcf-field input[type="text"],
    .hmcf-field input[type="email"],
    .hmcf-field input[type="tel"],
    .hmcf-field input[type="number"],
    .hmcf-field select,
    .hmcf-field textarea {
        font-size: 16px !important;   /* prevents iOS Safari zoom on focus */
        padding: 13px 14px !important;
        min-height: 50px !important;
    }

    .hmcf-submit-btn {
        width: 100%;
        font-size: 15px !important;
        padding: 15px !important;
    }

    .hmcf-actions {
        align-items: stretch;
    }
}
