/* =============================================================================
   OH Forms — Stylesheet
   JACB Services — v1.0.0
   Openhearth Unleashed palette
   ============================================================================= */

:root {
    --ohf-forest:      #2d4a3e;
    --ohf-sage:        #7d8570;
    --ohf-sage-light:  #a8b49a;
    --ohf-cream:       #f0ece0;
    --ohf-bg:          #f5f3ee;
    --ohf-border:      #d8d5cc;
    --ohf-text:        #1a2e25;
    --ohf-muted:       #5a6b5e;
    --ohf-error:       #b91c1c;
    --ohf-error-bg:    #fef2f2;
    --ohf-success:     #2d4a3e;
    --ohf-success-bg:  #edf2ea;
    --ohf-radius:      6px;
    --ohf-font:        inherit;
}

/* --- Wrapper --- */
.ohf-form-wrap {
    max-width: 760px;
    margin: 0 auto;
    font-family: var(--ohf-font);
}

/* --- Section Headings --- */
.ohf-section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ohf-forest);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0 0.75rem;
    margin: 1.75rem 0 0.75rem;
    border-bottom: 2px solid var(--ohf-sage-light);
}

.ohf-section-heading:first-of-type {
    margin-top: 0;
}

/* --- Rows --- */
.ohf-row {
    display: grid;
    gap: 1.25rem;
}

.ohf-row--two {
    grid-template-columns: 1fr 1fr;
}

/* --- Fields --- */
.ohf-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.ohf-field--submit {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* --- Labels --- */
.ohf-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ohf-text);
}

.ohf-required {
    color: var(--ohf-error);
    margin-left: 2px;
}

/* --- Inputs --- */
.ohf-input,
.ohf-textarea,
.ohf-select {
    font-family: var(--ohf-font);
    font-size: 1rem;
    color: var(--ohf-text);
    background: #ffffff;
    border: 1px solid var(--ohf-border);
    border-radius: var(--ohf-radius);
    padding: 0.65rem 0.875rem;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.ohf-input:focus,
.ohf-textarea:focus,
.ohf-select:focus {
    outline: none;
    border-color: var(--ohf-forest);
    box-shadow: 0 0 0 3px rgba(45,74,62,0.12);
}

.ohf-input::placeholder,
.ohf-textarea::placeholder {
    color: #aaa;
}

.ohf-input.ohf-invalid,
.ohf-textarea.ohf-invalid,
.ohf-select.ohf-invalid {
    border-color: var(--ohf-error);
    box-shadow: 0 0 0 3px rgba(185,28,28,0.1);
}

.ohf-textarea {
    resize: vertical;
    min-height: 120px;
}

.ohf-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 fill='%232d4a3e' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* --- Button --- */
.ohf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    font-family: var(--ohf-font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ohf-cream);
    background: var(--ohf-forest);
    border: 2px solid var(--ohf-forest);
    border-radius: var(--ohf-radius);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.ohf-btn:hover {
    background: #1a2e25;
    border-color: #1a2e25;
    transform: translateY(-1px);
}

.ohf-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.ohf-btn__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(240,236,224,0.4);
    border-top-color: var(--ohf-cream);
    border-radius: 50%;
    animation: ohf-spin 0.6s linear infinite;
    display: inline-block;
}

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

/* --- Privacy note --- */
.ohf-privacy {
    font-size: 0.8125rem;
    color: var(--ohf-muted);
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* --- Success message --- */
.ohf-success {
    background: var(--ohf-success-bg);
    border-left: 4px solid var(--ohf-success);
    border-radius: 0 var(--ohf-radius) var(--ohf-radius) 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.ohf-success__icon {
    font-size: 1.25rem;
    color: var(--ohf-success);
    font-weight: 700;
    flex-shrink: 0;
}

.ohf-success__msg {
    color: var(--ohf-success);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

/* --- Error message --- */
.ohf-error {
    background: var(--ohf-error-bg);
    border-left: 4px solid var(--ohf-error);
    border-radius: 0 var(--ohf-radius) var(--ohf-radius) 0;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.ohf-error__msg {
    color: var(--ohf-error);
    font-weight: 600;
    font-size: 0.9375rem;
    margin: 0;
}

/* --- Checkbox & Radio --- */
.ohf-checkbox-label,
.ohf-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--ohf-text);
    cursor: pointer;
    line-height: 1.5;
}

.ohf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ohf-checkbox-label input,
.ohf-radio-label input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--ohf-forest);
    flex-shrink: 0;
}

/* --- Honeypot --- */
.ohf-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .ohf-row--two {
        grid-template-columns: 1fr;
    }
}
