/* =========================================================
   SHINWA JLC — forms.css
   Public inquiry form, plus the loading/empty/error states used by
   the success-story gallery. Uses the tokens already defined in
   base.css — no new palette is introduced.
   ========================================================= */

.inquiry-section {
    width: var(--maxw);
    margin: 0 auto 46px;
    background: var(--paper);
    border-radius: var(--radius-lg);
    padding: 38px 28px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.inquiry-header {
    text-align: center;
    margin-bottom: 28px;
}

.inquiry-header h2 {
    font-family: var(--font-heading);
    color: var(--shu);
    font-size: clamp(24px, 3.6vw, 32px);
    margin-bottom: 8px;
}

.inquiry-header p {
    color: var(--ink-soft);
    font-size: 15px;
    max-width: 62ch;
    margin: 0 auto;
}

.inquiry-form {
    max-width: 780px;
    margin: 0 auto;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

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

.field-full {
    grid-column: 1 / -1;
}

.field label {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.field .optional {
    font-weight: 400;
    color: var(--ink-soft);
    font-size: 12.5px;
}

.field input,
.field select,
.field textarea {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ink);
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    width: 100%;
    /* 16px on mobile prevents iOS Safari zooming in on focus. */
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.7;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    background: var(--paper);
    border-color: var(--shu);
    box-shadow: 0 0 0 3px rgba(163, 35, 31, 0.12);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.field-error {
    font-size: 13px;
    color: var(--shu-dark);
    font-weight: 500;
    min-height: 0;
}

.field-error:empty {
    display: none;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
    border-color: var(--shu);
    background: rgba(163, 35, 31, 0.04);
}

/* Honeypot: hidden from people, still reachable by naive bots.
   Not display:none, which some bots specifically skip. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--shu);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 14px 40px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15.5px;
    cursor: pointer;
    min-height: 48px;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.submit-btn:hover:not(:disabled) {
    background: var(--shu-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ---------- Result banners ---------- */
.form-result {
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-top: 22px;
    font-size: 15px;
    line-height: 1.65;
    border: 1px solid;
}

.form-result h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    margin-bottom: 6px;
}

.form-result.is-success {
    background: rgba(200, 151, 63, 0.1);
    border-color: rgba(200, 151, 63, 0.5);
    color: var(--ink);
}

.form-result.is-error {
    background: rgba(163, 35, 31, 0.06);
    border-color: rgba(163, 35, 31, 0.4);
    color: var(--ink);
}

.form-result.is-warning {
    background: rgba(200, 151, 63, 0.14);
    border-color: rgba(200, 151, 63, 0.55);
}

.ticket-ref {
    display: inline-block;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin: 10px 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--shu);
}

.turnstile-holder {
    display: flex;
    justify-content: center;
    min-height: 65px;
}

/* ---------- Gallery states (success.html) ---------- */
.gallery-state {
    padding: 46px 20px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 15px;
}

.gallery-state .spinner {
    border-color: rgba(34, 28, 25, 0.15);
    border-top-color: var(--shu);
    margin: 0 auto 14px;
    width: 26px;
    height: 26px;
}

.success-gallery figcaption {
    padding: 12px 14px;
    background: var(--paper);
    text-align: left;
}

.success-gallery figcaption strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 14.5px;
    color: var(--shu);
    margin-bottom: 2px;
}

.success-gallery figcaption span {
    font-size: 13px;
    color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .field-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .inquiry-section {
        padding: 26px 18px;
    }

    .field input,
    .field select,
    .field textarea {
        font-size: 16px;
    }

    .submit-btn {
        width: 100%;
    }
}
