/* ========================================
   HOOT FORMS — Theme-Matched Styles
   Uses Hoot & Hue CSS variables for
   consistent design across the site.
   ======================================== */

/* --- Form Wrapper --- */
.hoot-form-wrap {
    max-width: 800px;
    margin: 0 auto;
}

.hoot-return-form-wrap {
    max-width: 900px;
}

/* --- Fieldsets --- */
.hoot-form-fieldset {
    border: 1px solid var(--hoot-border, #DDD8D2);
    border-radius: var(--hoot-radius, 10px);
    padding: 24px 24px 20px;
    margin-bottom: 24px;
    background: var(--hoot-card, #F5F2EE);
}

.hoot-form-legend {
    font-family: var(--hoot-font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--hoot-fg, #2C2520);
    padding: 0 8px;
    margin-left: -8px;
}

/* --- Grid Layouts --- */
.hoot-form-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.hoot-form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.hoot-form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* --- Form Groups --- */
.hoot-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hoot-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--hoot-fg, #2C2520);
    font-family: var(--hoot-font-body, 'Inter', sans-serif);
}

.hoot-form-group .required {
    color: var(--hoot-accent, #C07350);
}

/* --- Inputs --- */
.hoot-form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--hoot-border, #DDD8D2);
    border-radius: var(--hoot-radius, 10px);
    font-family: var(--hoot-font-body, 'Inter', sans-serif);
    font-size: 14px;
    color: var(--hoot-fg, #2C2520);
    background: #fff;
    transition: border-color var(--hoot-transition, 0.3s ease), box-shadow var(--hoot-transition, 0.3s ease);
    -webkit-appearance: none;
    appearance: none;
}

.hoot-form-input:focus {
    outline: none;
    border-color: var(--hoot-primary, #6B5B4E);
    box-shadow: 0 0 0 3px rgba(107, 91, 78, 0.12);
}

.hoot-form-input::placeholder {
    color: var(--hoot-muted-fg, #8A8078);
    opacity: 0.7;
}

/* Select */
.hoot-form-select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B5B4E' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Textarea */
.hoot-form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* --- Error Messages --- */
.hoot-form-error {
    font-size: 12px;
    color: #C83C3C;
    min-height: 16px;
    display: block;
}

.hoot-form-input.has-error {
    border-color: #C83C3C;
    box-shadow: 0 0 0 3px rgba(200, 60, 60, 0.1);
}

/* --- File Upload Area --- */
.hoot-file-upload-area {
    position: relative;
    border: 2px dashed var(--hoot-border, #DDD8D2);
    border-radius: var(--hoot-radius, 10px);
    padding: 24px 16px;
    text-align: center;
    transition: border-color var(--hoot-transition, 0.3s ease), background var(--hoot-transition, 0.3s ease);
    cursor: pointer;
    background: rgba(250, 248, 245, 0.5);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hoot-file-upload-area:hover,
.hoot-file-upload-area.drag-over {
    border-color: var(--hoot-primary, #6B5B4E);
    background: rgba(107, 91, 78, 0.04);
}

.hoot-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.hoot-file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--hoot-muted-fg, #8A8078);
    font-size: 13px;
    pointer-events: none;
}

.hoot-file-icon {
    font-size: 28px;
    line-height: 1;
}

.hoot-file-upload-placeholder small {
    font-size: 11px;
    opacity: 0.7;
}

/* File Preview */
.hoot-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hoot-file-preview:empty {
    display: none;
}

.hoot-file-preview-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--hoot-border, #DDD8D2);
    position: relative;
}

.hoot-file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hoot-file-preview-video {
    width: 100%;
    padding: 8px 0 0;
    font-size: 12px;
    color: var(--hoot-muted-fg, #8A8078);
}

/* --- Submit Button --- */
.hoot-form-actions {
    margin-top: 8px;
}

.hoot-form-submit {
    min-width: 180px;
    min-height: 50px;
    font-size: 15px;
}

.hoot-form-submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Spinner */
.hoot-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(250, 248, 245, 0.3);
    border-top-color: var(--hoot-primary-fg, #FAF8F5);
    border-radius: 50%;
    animation: hoot-spin 0.7s linear infinite;
}

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

/* --- Form Message (success/error) --- */
.hoot-form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--hoot-radius, 10px);
    font-size: 14px;
    line-height: 1.5;
}

.hoot-form-message.success {
    background: rgba(74, 158, 92, 0.08);
    border: 1px solid rgba(74, 158, 92, 0.3);
    color: var(--hoot-success, #4A9E5C);
}

.hoot-form-message.error {
    background: rgba(200, 60, 60, 0.06);
    border: 1px solid rgba(200, 60, 60, 0.25);
    color: #C83C3C;
}

/* --- Honeypot --- */
.hoot-hp-field {
    display: none !important;
    visibility: hidden;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .hoot-form-grid-2,
    .hoot-form-grid-3 {
        grid-template-columns: 1fr;
    }

    .hoot-form-fieldset {
        padding: 18px 16px 14px;
    }

    .hoot-form-wrap {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hoot-form-input {
        padding: 10px 12px;
        font-size: 16px; /* prevent iOS zoom */
    }

    .hoot-form-submit {
        width: 100%;
    }

    .hoot-file-upload-area {
        padding: 18px 12px;
    }
}
