/**
 * ASARH Contact Form - Styles
 * Uses ASARH Studio theme CSS variables for consistency
 */

/* ---- Form Base ---- */
.acf-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md, 24px);
}

/* ---- Rows ---- */
.acf-form__row--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md, 24px);
}

@media (max-width: 600px) {
    .acf-form__row--half {
        grid-template-columns: 1fr;
    }
}

/* ---- Fields ---- */
.acf-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.acf-form__field label {
    font-family: var(--font-accent, 'Montserrat', sans-serif);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-primary, #000);
}

.acf-form__field label span {
    color: #c0392b;
}

/* ---- Inputs ---- */
.acf-form__field input,
.acf-form__field select,
.acf-form__field textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--color-border, #eee);
    background: var(--color-surface, #fff);
    color: var(--color-primary, #000);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

.acf-form__field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

.acf-form__field input:focus,
.acf-form__field select:focus,
.acf-form__field textarea:focus {
    border-color: var(--color-primary, #000);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #000) 8%, transparent);
}

.acf-form__field textarea {
    min-height: 140px;
    resize: vertical;
}

/* ---- Placeholder ---- */
.acf-form__field input::placeholder,
.acf-form__field textarea::placeholder {
    color: var(--color-muted, #888);
    opacity: 0.6;
}

/* ---- Field Errors ---- */
.acf-form__error {
    font-size: 0.78rem;
    color: #c0392b;
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, min-height 0.3s ease;
}

.acf-form__error.visible {
    opacity: 1;
    min-height: 1.2em;
}

.acf-form__field.has-error input,
.acf-form__field.has-error select,
.acf-form__field.has-error textarea {
    border-color: #c0392b;
}

/* ---- Honeypot ---- */
.acf-form__hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* ---- Submit Button ---- */
.acf-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
    font-family: var(--font-accent, 'Montserrat', sans-serif);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 16px 40px;
    background: var(--color-primary, #000);
    color: var(--color-secondary, #fff);
    border: 2px solid var(--color-primary, #000);
    cursor: pointer;
    transition: background 0.4s ease, color 0.4s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.acf-form__submit:hover {
    background: transparent;
    color: var(--color-primary, #000);
}

.acf-form__submit:active {
    transform: scale(0.97);
}

/* Submit states */
.acf-form__submit-loading,
.acf-form__submit-done {
    display: none;
    align-items: center;
    gap: 8px;
}

.acf-form__submit.is-loading .acf-form__submit-text { display: none; }
.acf-form__submit.is-loading .acf-form__submit-loading { display: inline-flex; }
.acf-form__submit.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.acf-form__submit.is-done .acf-form__submit-text { display: none; }
.acf-form__submit.is-done .acf-form__submit-loading { display: none; }
.acf-form__submit.is-done .acf-form__submit-done { display: inline-flex; }
.acf-form__submit.is-done {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

/* ---- Status Message ---- */
.acf-form__status {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
}

.acf-form__status.visible {
    max-height: 120px;
    opacity: 1;
    padding: var(--space-sm, 16px) var(--space-md, 24px);
}

.acf-form__status.success {
    background: color-mix(in srgb, #27ae60 10%, var(--color-surface, #fff));
    color: #27ae60;
    border-left: 3px solid #27ae60;
}

.acf-form__status.error {
    background: color-mix(in srgb, #c0392b 10%, var(--color-surface, #fff));
    color: #c0392b;
    border-left: 3px solid #c0392b;
}

/* ---- Entrance animation ---- */
.acf-form__field,
.acf-form__submit {
    opacity: 0;
    transform: translateY(12px);
    animation: acfFadeIn 0.5s ease forwards;
}

.acf-form__row--half:nth-child(1) .acf-form__field:nth-child(1) { animation-delay: 0.05s; }
.acf-form__row--half:nth-child(1) .acf-form__field:nth-child(2) { animation-delay: 0.1s; }
.acf-form__row--half:nth-child(2) .acf-form__field:nth-child(1) { animation-delay: 0.15s; }
.acf-form__row--half:nth-child(2) .acf-form__field:nth-child(2) { animation-delay: 0.2s; }
.acf-form > .acf-form__field { animation-delay: 0.25s; }
.acf-form__submit { animation-delay: 0.3s; }

@keyframes acfFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
