/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none;
    gap: var(--space-2);
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

input, textarea, select {
    width: 100%;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    height: auto;
    resize: vertical;
    min-height: 80px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-muted);
}

input:disabled, textarea:disabled, select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ============================================
   MESSAGE BOXES
   ============================================ */

.message {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-5);
    font-size: 14px;
}

.message.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.message.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

@media (max-width: 480px) {
    /* Smaller form inputs */
    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* ============================================
   FORM VALIDATION ERRORS
   ============================================ */

.field-error {
    border-color: var(--error) !important;
    background: var(--error-bg) !important;
}

.field-error:focus {
    box-shadow: 0 0 0 2px var(--error-bg) !important;
    border-color: var(--error) !important;
}
