/* ==========================================================================
   SIAMCONSULT FORM — Professional Stylesheet
   Template: templates/contact-form.php (plugin's own form)
   Classes: .siamconsult-form-wrapper, .scfh-section, .scfh-grid, .scfh-field
   Colors: Navy #051F39 | Gold #F4C430 | White #FFFFFF
   ========================================================================== */

/* ==========================================================================
   1. WRAPPER & TWO-COLUMN GRID (Desktop)
   ========================================================================== */

.siamconsult-form-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #FFFFFF;
    background: #051F39;
    border: 1px solid rgba(244, 196, 48, 0.3);
    border-radius: 12px;
    padding: 40px;
    max-width: 860px;
    margin: 0 auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.siamconsult-form-wrapper * {
    box-sizing: border-box;
}

/* Form header */
.scfh-form-header {
    text-align: center;
    margin-bottom: 36px;
}

.scfh-form-header h2 {
    color: #F4C430;
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.scfh-form-header p {
    color: #8AA5B8;
    margin: 0;
    font-size: 15px;
}

/* ==========================================================================
   2. SECTIONS (FIELDSETS) — No borders, gold headers
   ========================================================================== */

.scfh-section {
    padding: 0;
    margin: 0 0 32px;
    border: none;
    border-bottom: 1px solid rgba(244, 196, 48, 0.2);
}

.scfh-section:last-of-type {
    border-bottom: none;
    margin-bottom: 8px;
}

.scfh-section legend {
    color: #F4C430;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 20px;
    padding: 0 0 10px;
    border-bottom: 2px solid #F4C430;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.scfh-section legend span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #F4C430;
    color: #051F39;
    font-weight: 700;
    font-size: 12px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

/* ==========================================================================
   3. TWO-COLUMN GRID (Desktop)
   ========================================================================== */

.scfh-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .scfh-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   4. FIELDS
   ========================================================================== */

.scfh-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scfh-field label {
    color: #99CCFF;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.scfh-field label .required {
    color: #F4C430;
    margin-left: 2px;
}

/* ==========================================================================
   5. UNIFIED INPUT BASE (text, email, tel, select, textarea, date)
   ========================================================================== */

.scfh-field input,
.scfh-field select,
.scfh-field textarea {
    width: 100%;
    background: #0D1B2A;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    color: #FFFFFF;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.scfh-field input::placeholder,
.scfh-field textarea::placeholder {
    color: rgba(255,255,255,0.5);
}

.scfh-field input:hover,
.scfh-field select:hover,
.scfh-field textarea:hover {
    border-color: #66B2FF;
}

.scfh-field input:focus,
.scfh-field select:focus,
.scfh-field textarea:focus {
    border-color: #F4C430;
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.2);
}

.scfh-field input:invalid:not(:placeholder-shown),
.scfh-field select:invalid:not([value=""]),
.scfh-field textarea:invalid:not(:placeholder-shown) {
    border-color: #FF6B6B;
}

.scfh-field textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

/* ==========================================================================
   6. SELECT / DROPDOWN — Custom arrow, no native styling
   ========================================================================== */

.scfh-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23F4C430' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 44px;
}

/* Gold arrow on focus */
.scfh-field select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23F4C430' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Options — dark background */
.scfh-field select option {
    background: #051F39;
    color: #FFFFFF;
    padding: 10px 12px;
}

/* ==========================================================================
   7. FILE UPLOAD — Drag & Drop Zone
   ========================================================================== */

.scfh-file-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scfh-file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.scfh-file-text {
    display: block;
    background: rgba(244, 196, 48, 0.05);
    border: 2px dashed #FFFFFF;
    border-radius: 8px;
    color: #FFFFFF;
    padding: 22px 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s;
    pointer-events: none;
}

.scfh-file-upload:hover .scfh-file-text {
    border-color: #F4C430;
    background: rgba(244, 196, 48, 0.12);
}

.scfh-file-upload:focus-within .scfh-file-text {
    border-color: #F4C430;
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.2);
}

/* Filename state (JS adds .has-file) */
.scfh-file-upload.has-file .scfh-file-text {
    background: rgba(244, 196, 48, 0.15);
    border-style: solid;
    border-color: #F4C430;
    color: #F4C430;
}

/* ==========================================================================
   8. SUBMIT BUTTON — 50% width, right-aligned, Gold gradient
   ========================================================================== */

.scfh-submit-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(244, 196, 48, 0.2);
}

.scfh-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 50%;
    max-width: 280px;
    background: linear-gradient(135deg, #F4C430 0%, #e0b028 100%);
    color: #051F39;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(244, 196, 48, 0.3);
}

.scfh-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(244, 196, 48, 0.4);
}

.scfh-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.scfh-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.scfh-submit-btn .btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: #051F39;
    border-radius: 50%;
    animation: scfh-spin 0.8s linear infinite;
}

.scfh-submit-btn.loading .btn-text {
    display: none;
}

.scfh-submit-btn.loading .btn-loader {
    display: block;
}

@keyframes scfh-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   9. PRIVACY NOTE
   ========================================================================== */

.scfh-privacy {
    text-align: center;
    margin: 0;
    font-size: 12px;
    color: #8AA5B8;
    width: 100%;
}

.scfh-privacy a {
    color: #99CCFF;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.scfh-privacy a:hover {
    color: #F4C430;
    border-bottom-color: #F4C430;
}

/* ==========================================================================
   10. SUCCESS / ERROR STATES
   ========================================================================== */

.scfh-success,
.scfh-error {
    text-align: center;
    padding: 48px 24px;
    border-radius: 12px;
    animation: scfh-fade-in 0.4s ease;
}

.scfh-success {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid #4ECDC4;
}

.scfh-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #FF6B6B;
}

.scfh-success h3 { color: #4ECDC4; }
.scfh-error h3 { color: #FF6B6B; }

.scfh-success p,
.scfh-error p {
    color: #FFFFFF;
    margin: 8px 0 0;
    font-size: 16px;
}

@keyframes scfh-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   11. FIELD ERROR MESSAGE (JS injects)
   ========================================================================== */

.scfh-field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #FF6B6B;
    border-radius: 6px;
    color: #FF6B6B;
    font-size: 12px;
    font-weight: 500;
    animation: scfh-slide-down 0.2s ease;
}

@keyframes scfh-slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   12. MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 767px) {
    .siamconsult-form-wrapper {
        padding: 24px;
        margin: 12px;
    }

    .scfh-form-header h2 {
        font-size: 22px;
    }

    .scfh-section {
        margin-bottom: 24px;
    }

    .scfh-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .scfh-grid[style*="margin-top"] {
        margin-top: 0 !important;
    }

    .scfh-submit-btn {
        width: 100%;
        max-width: none;
    }

    .scfh-field input,
    .scfh-field select,
    .scfh-field textarea {
        padding: 14px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .scfh-file-text {
        padding: 20px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .siamconsult-form-wrapper {
        padding: 20px 16px;
    }

    .scfh-section legend {
        font-size: 13px;
    }

    .scfh-section legend span {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}