/*
 * CodeHazel Contact Form — Default Styles
 * Deliberately neutral/minimal so it doesn't fight your theme.
 * Override anything via Settings → Custom CSS (survives plugin updates)
 * or by targeting these classes in your theme's stylesheet.
 */

.chcf-form-wrap {
    width: 100%;
    max-width: 560px;
}

.chcf-form-title {
    margin: 0 0 24px;
    font-size: 1.5rem;
    font-weight: 700;
}

.chcf-form {
    display: flex;
    flex-flow: row wrap;
    gap: 20px;
}

.chcf-form-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 100%; /* .chcf-field-full — default */
    min-width: 0;
}

/* Two "half" fields placed next to each other sit side by side; on
   narrow screens they stack full-width automatically (see media query). */
.chcf-form-group.chcf-field-half {
    flex: 1 1 calc(50% - 10px);
}

/* Submit button + status messages always take the full row, even
   though .chcf-form is now a flex-wrap row for the fields above them. */
.chcf-form-submit,
.chcf-form-fail-box {
    flex: 1 1 100%;
}

.chcf-form-group label {
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.chcf-form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid #898989;
    border-radius: 8px;
    background: transparent;
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.chcf-form-input:focus {
    border-color: #f58327;
    box-shadow: 0 0 4px 2px rgba(245, 131, 39, 0.4);
}

.chcf-form-textarea {
    resize: vertical;
    min-height: 100px;
}

select.chcf-form-input {
    cursor: pointer;
}

.chcf-form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: #f58327;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.chcf-form-submit:hover {
    background: #d96e1a;
}

.chcf-form-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.chcf-submit-spinner {
    display: none;
    animation: chcf-spin 0.8s linear infinite;
}

.chcf-form-submit.chcf-submitting .chcf-submit-label {
    opacity: 0.7;
}
.chcf-form-submit.chcf-submitting .chcf-submit-spinner {
    display: inline-block;
}

@keyframes chcf-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Success container — replaces the form entirely on success ── */
.chcf-form-success-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 32px 20px;
    border-radius: 10px;
    background: rgba(46, 125, 50, 0.06);
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.chcf-success-icon {
    color: #2e7d32;
}

.chcf-success-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #1d2327;
}

.chcf-form-reset-btn {
    margin-top: 4px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2e7d32;
    background: transparent;
    border: 1px solid rgba(46, 125, 50, 0.35);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}
.chcf-form-reset-btn:hover {
    background: rgba(46, 125, 50, 0.08);
}

/* ── Error container — sits below the submit button, form stays visible ── */
.chcf-form-fail-box {
    flex: 1 1 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(198, 40, 40, 0.06);
    border: 1px solid rgba(198, 40, 40, 0.25);
}

.chcf-fail-text {
    margin: 0;
    font-size: 0.88rem;
    color: #c62828;
    text-align: center;
}

@media (max-width: 480px) {
    .chcf-form-title { font-size: 1.25rem; }
    .chcf-form-group.chcf-field-half { flex: 1 1 100%; }
}
