/**
 * Host Application Form — Styles
 *
 * Standalone CSS for the 5-step host application form.
 * Uses LH brand colours and patterns from the website style guide.
 * When porting to WP theme, enqueue this file alongside the form template.
 *
 * @since 2026-02-25
 */

/* ============================================
   CSS CUSTOM PROPERTIES (LH Brand Subset)
   ============================================ */
:root {
    --haf-navy: #1b2a4a;
    --haf-blue: #2294D2;
    --haf-blue-light: #f0f8ff;
    --haf-magenta: #c0267e;
    --haf-magenta-dark: #a31f6b;
    --haf-magenta-light: #fff5fb;
    --haf-gold: #e8a33d;
    --haf-green: #16a34a;
    --haf-green-light: #f0fdf4;
    --haf-red: #dc2626;
    --haf-red-light: #fef2f2;
    --haf-grey-50: #f9fafb;
    --haf-grey-100: #f3f4f6;
    --haf-grey-200: #e5e7eb;
    --haf-grey-300: #d1d5db;
    --haf-grey-400: #9ca3af;
    --haf-grey-500: #6b7280;
    --haf-grey-600: #4b5563;
    --haf-grey-700: #374151;
    --haf-grey-800: #1f2937;
    --haf-white: #ffffff;
    --haf-font: "proxima-nova", "Proxima Nova", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --haf-radius: 8px;
    --haf-radius-lg: 12px;
    --haf-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --haf-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --haf-transition: 0.2s ease;
}

/* ============================================
   FORM CONTAINER
   ============================================ */
.haf-form {
    font-family: var(--haf-font);
    color: var(--haf-navy);
    line-height: 1.6;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
    -webkit-font-smoothing: antialiased;
}

.haf-form *,
.haf-form *::before,
.haf-form *::after {
    box-sizing: border-box;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.haf-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
}

.haf-progress__bar {
    flex: 1;
    height: 4px;
    background: var(--haf-grey-200);
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.haf-progress__bar.is-complete {
    background: var(--haf-magenta);
}

.haf-progress__bar.is-active {
    background: var(--haf-blue);
}

.haf-progress__labels {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.haf-progress__label {
    flex: 1;
    font-size: 0.75rem;
    color: var(--haf-grey-600);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--haf-transition);
}

.haf-progress__label.is-active {
    color: var(--haf-navy);
    font-weight: 600;
}

.haf-progress__label.is-complete {
    color: var(--haf-magenta);
}

/* ============================================
   STEP PANELS
   ============================================ */
.haf-step {
    display: none;
    animation: haf-fadeIn 0.3s ease;
}

.haf-step.is-active {
    display: block;
}

@keyframes haf-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step header */
.haf-step__header {
    margin-bottom: 24px;
}

.haf-step__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--haf-navy);
    margin: 0 0 4px;
    line-height: 1.3;
}

.haf-step__subtitle {
    font-size: 0.9375rem;
    color: var(--haf-grey-500);
    margin: 0;
}

.haf-step__counter {
    font-size: 0.8125rem;
    color: var(--haf-grey-600);
    font-weight: 500;
    margin-bottom: 4px;
}

/* ============================================
   ACCORDION (Step 1 info sections)
   ============================================ */
.haf-accordion {
    border: 1px solid var(--haf-grey-200);
    border-radius: var(--haf-radius);
    margin-bottom: 12px;
    background: var(--haf-white);
    overflow: hidden;
}

.haf-accordion + .haf-accordion {
    margin-top: 0;
}

.haf-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--haf-navy);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color var(--haf-transition);
}

.haf-accordion summary::-webkit-details-marker {
    display: none;
}

.haf-accordion summary::after {
    content: "";
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    transition: transform 0.2s ease;
}

.haf-accordion[open] summary::after {
    transform: rotate(180deg);
}

.haf-accordion summary:hover {
    background: var(--haf-grey-50);
}

.haf-accordion__body {
    padding: 0 16px 16px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--haf-grey-700);
}

.haf-accordion__body p {
    margin: 0 0 12px;
}

.haf-accordion__body p:last-child {
    margin-bottom: 0;
}

.haf-accordion__body strong {
    color: var(--haf-navy);
}

.haf-accordion__body a {
    color: var(--haf-magenta);
    text-decoration: underline;
}

.haf-accordion__body a:hover {
    color: var(--haf-magenta-dark);
}

/* ============================================
   FORM SECTIONS
   ============================================ */
.haf-section {
    background: var(--haf-white);
    border: 1px solid var(--haf-grey-200);
    border-radius: var(--haf-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--haf-shadow);
}

.haf-section__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--haf-navy);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--haf-grey-100);
}

/* ============================================
   FORM FIELDS
   ============================================ */
.haf-field {
    margin-bottom: 20px;
}

.haf-field:last-child {
    margin-bottom: 0;
}

.haf-field__label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--haf-grey-800);
    margin-bottom: 6px;
}

.haf-field__label .haf-required {
    color: var(--haf-magenta);
    margin-left: 2px;
}

.haf-field__hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--haf-grey-600);
    margin-top: 4px;
    line-height: 1.5;
}

.haf-field__error {
    display: none;
    font-size: 0.8125rem;
    color: var(--haf-red);
    margin-top: 4px;
    line-height: 1.4;
}

.haf-field.has-error .haf-field__error {
    display: block;
}

/* Text inputs, selects, textareas */
.haf-input,
.haf-select,
.haf-textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-family: var(--haf-font);
    font-size: 1rem;
    color: var(--haf-navy);
    background: var(--haf-white);
    border: 1px solid var(--haf-grey-300);
    border-radius: var(--haf-radius);
    min-height: 44px;
    transition: border-color var(--haf-transition), box-shadow var(--haf-transition);
}

.haf-input::placeholder,
.haf-textarea::placeholder {
    color: var(--haf-grey-500);
}

.haf-input:focus,
.haf-select:focus,
.haf-textarea:focus {
    outline: none;
    border-color: var(--haf-blue);
    box-shadow: 0 0 0 3px rgba(34, 148, 210, 0.2);
}

.haf-field.has-error .haf-input,
.haf-field.has-error .haf-select,
.haf-field.has-error .haf-textarea {
    border-color: var(--haf-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Select with custom arrow */
.haf-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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

/* Textarea */
.haf-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

/* ============================================
   INLINE FIELD GROUPS (Name, Address)
   ============================================ */
.haf-field-row {
    display: grid;
    gap: 12px;
}

.haf-field-row--2 {
    grid-template-columns: 1fr 1fr;
}

.haf-field-row--3 {
    grid-template-columns: auto 1fr 1fr;
}

.haf-field-row--name {
    grid-template-columns: 100px 1fr 1fr;
}

.haf-field-row--address {
    grid-template-columns: 1fr 1fr 120px;
}

@media (max-width: 600px) {
    .haf-field-row--2,
    .haf-field-row--3,
    .haf-field-row--name,
    .haf-field-row--address {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CHECKBOX & RADIO GROUPS
   ============================================ */
.haf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.haf-checkbox-group--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.haf-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 6px 0;
    line-height: 1.5;
}

.haf-checkbox-item input[type="checkbox"],
.haf-checkbox-item input[type="radio"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--haf-magenta);
    cursor: pointer;
}

.haf-checkbox-item span {
    font-size: 0.9375rem;
    color: var(--haf-grey-700);
}

/* Standalone consent checkbox (with longer text) */
.haf-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--haf-grey-50);
    border: 1px solid var(--haf-grey-200);
    border-radius: var(--haf-radius);
    cursor: pointer;
    transition: border-color var(--haf-transition), background-color var(--haf-transition);
}

.haf-consent-checkbox:hover {
    border-color: var(--haf-grey-300);
    background: var(--haf-grey-100);
}

.haf-consent-checkbox.is-checked {
    border-color: var(--haf-magenta);
    background: var(--haf-magenta-light);
}

.haf-consent-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    accent-color: var(--haf-magenta);
    cursor: pointer;
}

.haf-consent-checkbox span {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--haf-grey-700);
}

.haf-consent-checkbox a {
    color: var(--haf-magenta);
    text-decoration: underline;
}

.haf-consent-checkbox a:hover {
    color: var(--haf-magenta-dark);
}

.haf-field.has-error .haf-consent-checkbox {
    border-color: var(--haf-red);
    background: var(--haf-red-light);
}

/* ============================================
   RADIO CARD GROUP (Meal plans — Yes/No/Possibly)
   ============================================ */
.haf-radio-cards {
    display: flex;
    gap: 8px;
}

.haf-radio-card {
    flex: 1;
    position: relative;
}

.haf-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.haf-radio-card label {
    display: block;
    padding: 10px 12px;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--haf-grey-600);
    background: var(--haf-white);
    border: 1px solid var(--haf-grey-300);
    border-radius: var(--haf-radius);
    cursor: pointer;
    transition: all var(--haf-transition);
}

.haf-radio-card label:hover {
    border-color: var(--haf-blue);
    color: var(--haf-navy);
}

.haf-radio-card input[type="radio"]:checked + label {
    border-color: var(--haf-magenta);
    background: var(--haf-magenta-light);
    color: var(--haf-magenta);
    font-weight: 600;
}

.haf-radio-card input[type="radio"]:focus-visible + label {
    box-shadow: 0 0 0 3px rgba(34, 148, 210, 0.2);
}

.haf-field.has-error .haf-radio-card label {
    border-color: var(--haf-red);
}

/* ============================================
   IMAGE UPLOAD
   ============================================ */
.haf-upload {
    border: 2px dashed var(--haf-grey-300);
    border-radius: var(--haf-radius-lg);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--haf-transition), background-color var(--haf-transition);
    position: relative;
}

.haf-upload:hover {
    border-color: var(--haf-blue);
    background: var(--haf-blue-light);
}

.haf-upload.is-dragover {
    border-color: var(--haf-magenta);
    background: var(--haf-magenta-light);
}

.haf-upload__icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

.haf-upload__text {
    font-size: 0.9375rem;
    color: var(--haf-grey-600);
    margin: 0;
}

.haf-upload__text strong {
    color: var(--haf-blue);
    cursor: pointer;
}

.haf-upload__limit {
    font-size: 0.8125rem;
    color: var(--haf-grey-600);
    margin: 6px 0 0;
}

.haf-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Image preview grid */
.haf-upload-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.haf-upload-preview {
    position: relative;
    border-radius: var(--haf-radius);
    overflow: hidden;
    border: 1px solid var(--haf-grey-200);
    background: var(--haf-grey-50);
}

.haf-upload-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.haf-upload-preview__info {
    padding: 6px 8px;
    font-size: 0.75rem;
    color: var(--haf-grey-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.haf-upload-preview__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: var(--haf-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: background-color var(--haf-transition);
}

.haf-upload-preview__remove:hover {
    background: rgba(220, 38, 38, 0.9);
}

/* ============================================
   INFO BANNERS
   ============================================ */
.haf-info {
    padding: 16px 20px;
    background: var(--haf-blue-light);
    border-left: 4px solid var(--haf-blue);
    border-radius: 0 var(--haf-radius) var(--haf-radius) 0;
    margin-bottom: 20px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--haf-grey-700);
}

.haf-info p {
    margin: 0 0 8px;
}

.haf-info p:last-child {
    margin-bottom: 0;
}

.haf-info strong {
    color: var(--haf-navy);
}

.haf-info a {
    color: var(--haf-magenta);
    text-decoration: underline;
}

/* ============================================
   REVIEW SUMMARY (Step 5)
   ============================================ */
.haf-review {
    background: var(--haf-grey-50);
    border: 1px solid var(--haf-grey-200);
    border-radius: var(--haf-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.haf-review__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--haf-white);
    border-bottom: 1px solid var(--haf-grey-200);
    cursor: pointer;
    user-select: none;
}

.haf-review__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--haf-navy);
}

.haf-review__toggle {
    font-size: 0.8125rem;
    color: var(--haf-blue);
    font-weight: 500;
}

.haf-review__body {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.haf-review.is-open .haf-review__body {
    padding: 16px 20px;
    max-height: 2000px;
}

.haf-review__section {
    margin-bottom: 16px;
}

.haf-review__section:last-child {
    margin-bottom: 0;
}

.haf-review__section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--haf-magenta);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
}

.haf-review__row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--haf-grey-100);
}

.haf-review__row:last-child {
    border-bottom: none;
}

.haf-review__label {
    color: var(--haf-grey-600);
    flex-shrink: 0;
    margin-right: 16px;
}

.haf-review__value {
    color: var(--haf-navy);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.haf-review__value:empty::before {
    content: "\2014";
    color: var(--haf-grey-300);
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */
.haf-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--haf-grey-100);
}

.haf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--haf-font);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    min-height: 44px;
    transition: all var(--haf-transition);
    text-decoration: none;
    line-height: 1;
}

.haf-btn:focus-visible {
    outline: 3px solid var(--haf-blue);
    outline-offset: 2px;
}

.haf-btn--next {
    background: linear-gradient(135deg, #2294D2, #1a7ab8);
    color: var(--haf-white);
    box-shadow: 0 4px 12px rgba(34, 148, 210, 0.25);
    margin-left: auto;
}

.haf-btn--next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 148, 210, 0.35);
}

.haf-btn--next:active {
    transform: translateY(0);
}

.haf-btn--back {
    background: transparent;
    color: var(--haf-grey-600);
    border: 1px solid var(--haf-grey-300);
}

.haf-btn--back:hover {
    background: var(--haf-grey-50);
    color: var(--haf-navy);
    border-color: var(--haf-grey-400);
}

.haf-btn--submit {
    background: linear-gradient(135deg, #c0267e, #a31f6b);
    color: var(--haf-white);
    box-shadow: 0 4px 12px rgba(192, 38, 126, 0.25);
    padding: 14px 36px;
    font-size: 1.0625rem;
}

.haf-btn--submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(192, 38, 126, 0.35);
}

.haf-btn--submit:active {
    transform: translateY(0);
}

.haf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Arrow icons */
.haf-btn--next::after {
    content: "\2192";
}

.haf-btn--back::before {
    content: "\2190";
}

/* ============================================
   LOADING / SUCCESS / ERROR STATES
   ============================================ */
.haf-loading {
    display: none;
    text-align: center;
    padding: 48px 24px;
}

.haf-loading.is-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.haf-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--haf-grey-200);
    border-top-color: var(--haf-magenta);
    border-radius: 50%;
    animation: haf-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.haf-loading__text {
    font-size: 1rem;
    color: var(--haf-grey-600);
}

/* Success state */
.haf-success {
    display: none;
    text-align: center;
    padding: 48px 24px;
    background: var(--haf-green-light);
    border: 1px solid #bbf7d0;
    border-radius: var(--haf-radius-lg);
}

.haf-success.is-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.haf-success__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--haf-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--haf-white);
    font-size: 28px;
}

.haf-success__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--haf-navy);
    margin: 0 0 8px;
}

.haf-success__message {
    font-size: 0.9375rem;
    color: var(--haf-grey-600);
    margin: 0;
    line-height: 1.6;
}

/* Error state */
.haf-error-banner {
    display: none;
    padding: 14px 16px;
    background: var(--haf-red-light);
    border: 1px solid #fecaca;
    border-radius: var(--haf-radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--haf-red);
    line-height: 1.5;
}

.haf-error-banner.is-active {
    display: block;
}

/* ============================================
   CONDITIONAL FIELD (referrer name)
   ============================================ */
.haf-conditional {
    display: none;
    animation: haf-fadeIn 0.2s ease;
}

.haf-conditional.is-visible {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .haf-form {
        padding: 0 12px;
    }

    .haf-step__title {
        font-size: 1.25rem;
    }

    .haf-section {
        padding: 16px;
    }

    .haf-nav {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .haf-btn {
        width: 100%;
    }

    .haf-btn--next {
        margin-left: 0;
    }

    .haf-radio-cards {
        flex-direction: column;
    }

    .haf-progress__labels {
        display: none;
    }

    .haf-review__row {
        flex-direction: column;
        gap: 2px;
    }

    .haf-review__value {
        text-align: left;
    }

    .haf-upload {
        padding: 24px 16px;
    }

    .haf-upload-previews {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .haf-progress,
    .haf-nav,
    .haf-upload,
    .haf-btn {
        display: none !important;
    }

    .haf-step {
        display: block !important;
    }

    .haf-section {
        border: none;
        box-shadow: none;
        padding: 0;
    }
}
