/* =====================================================================
   Go Hawaii Outfitters -- forms.css
   Native forms (Contact, Get Started, Service). Builds on the existing
   .form-input / .uk-form-label styles in main.css. Loaded only on pages
   with a form, via hh_form_assets() in media/php/forms.php.
===================================================================== */

/* Brand tokens for the forms (Go Hawaii Outfitters olive #404d26). */
.hh-form-wrap {
    --text-dark: #222;
    --text-gray: #666;
    --light-gray: #f5f8fb;
    --gray: #d9dee3;
    --secondary-dark-green: #2f7d5d;
    --radius-sm: 4px;
    --gradient-primary: #404d26;
    --gradient-primary-hover: #2f3a1b;
}
.hh-form .form-input { border: 1px solid var(--gray); border-radius: var(--radius-sm); }
.hh-form .form-input:focus { border-color: #404d26; }

/* Honeypot: off-screen, NOT display:none (some bots skip hidden inputs). */
.hh-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.hh-form .uk-form-label { display: block; }
.hh-req { color: #c0392b; }
.hh-required-note { margin: 1rem 0 0; font-size: .85rem; color: var(--text-gray); }

/* Checkbox group */
.hh-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.hh-fieldset legend { padding: 0; }
.hh-check { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0; cursor: pointer; color: var(--text-dark); }
.hh-check .uk-checkbox { margin-top: 3px; flex: none; }

/* Field errors */
.hh-field-error { display: block; margin-top: 6px; font-size: .875rem; color: #a8324a; }
.hh-form [aria-invalid="true"].form-input { border-color: #a8324a !important; background: #fdf7f8; }
.hh-fieldset[aria-describedby] .uk-checkbox { border-color: #a8324a; }

/* Submit button: both labels ship in the markup and swap on .is-busy. */
.hh-submit-row { margin-top: 1.25rem; text-align: center; }
.hh-submit { min-width: 240px; border-radius: var(--radius-sm); background: var(--gradient-primary); }
.hh-submit:hover, .hh-submit:focus { background: var(--gradient-primary-hover); }
.hh-submit .hh-submit-busy { display: none; }
.hh-submit.is-busy .hh-submit-idle { display: none; }
.hh-submit.is-busy .hh-submit-busy { display: inline-flex; align-items: center; gap: 10px; }
.hh-submit[disabled] { opacity: .85; cursor: progress; }

.hh-spinner {
    display: inline-block; width: 16px; height: 16px; flex: none;
    border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    border-radius: 50%; animation: hh-spin .7s linear infinite;
}
.hh-form-status .hh-spinner { border-color: rgba(64, 77, 38, .25); border-top-color: #404d26; }
@keyframes hh-spin { to { transform: rotate(360deg); } }

/* Locked while in flight: reads as busy, not broken. */
.hh-form.is-sending .form-input,
.hh-form.is-sending .hh-check { opacity: .55; cursor: progress; }

/* Status region: hidden when empty, shown while sending and on error. */
.hh-form-status { display: none; }
.hh-form-status.is-visible {
    display: block; margin-top: 1.25rem; padding: 14px 16px; border-radius: var(--radius-sm);
}
.hh-form-status.is-sending { background: var(--light-gray); border-left: 4px solid #404d26; color: var(--text-dark); }
.hh-form-status.is-error   { background: #fdf1f3; border-left: 4px solid #a8324a; color: #6d1f30; }
.hh-status-line { display: flex; align-items: center; gap: 12px; }

/* Indeterminate bar: SMTP time is unknowable, so show motion, never a %. */
.hh-progress {
    display: block; height: 3px; margin-top: 12px; border-radius: 2px;
    background: rgba(64, 77, 38, .14); overflow: hidden;
}
.hh-progress::after {
    content: ""; display: block; width: 40%; height: 100%; border-radius: 2px;
    background: #404d26; animation: hh-indeterminate 1.15s ease-in-out infinite;
}
@keyframes hh-indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Completion panel (same markup on the AJAX and ?sent=1 paths). */
.hh-complete { text-align: center; padding: 34px 20px; outline: none; }
.hh-complete-icon {
    display: block; width: 62px; height: 62px; margin: 0 auto 20px;
    border-radius: 50%; background: var(--secondary-dark-green); position: relative;
    animation: hh-pop .35s cubic-bezier(.2, .8, .3, 1.2);
}
.hh-complete-icon::after {
    content: ""; position: absolute; left: 23px; top: 14px; width: 13px; height: 26px;
    border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
    animation: hh-check .3s ease-out .16s backwards;
}
.hh-complete-title { margin: 0 0 8px; color: var(--text-dark); font-weight: 700; }
.hh-complete-text { margin: 0 0 8px; color: var(--text-gray); }
.hh-send-another { margin-top: 14px; border-radius: var(--radius-sm); }
@keyframes hh-pop   { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes hh-check { from { opacity: 0; transform: rotate(45deg) scale(.5); } to { opacity: 1; transform: rotate(45deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
    .hh-spinner { animation-duration: 2.4s; }
    .hh-progress::after { animation-duration: 3s; }
    .hh-complete-icon, .hh-complete-icon::after { animation: none; }
}

@media (max-width: 639px) {
    .hh-submit { width: 100%; min-width: 0; }
}

/* Go Hawaii Outfitters additions: field help text and the file picker. */
.hh-help { display: block; margin: -2px 0 6px; font-size: .85rem; color: #666; }
.hh-file-input.form-input { padding: .6rem !important; cursor: pointer; background: #fafafa; }

/* Go Hawaii Outfitters: long checkbox/radio groups flow into columns on wider
   screens instead of one tall list (the Publication form has 10 groups). */
@media (min-width: 640px) {
    .hh-fieldset { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 20px; }
    .hh-fieldset .hh-check { margin: 4px 0; }
}
.hh-check .uk-checkbox, .hh-check .uk-radio { margin-top: 2px; }
