/* ════════════════════════════════════════
   COMPONENTS — Shared UI elements
   ════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 2rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
  text-transform: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--olive);
  color: var(--cream-light);
  box-shadow: 0 2px 12px rgba(90, 110, 78, 0.3);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--olive-deep);
  box-shadow: 0 4px 20px rgba(90, 110, 78, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--olive);
  border: 1.5px solid var(--sage);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--sage-muted);
  border-color: var(--olive);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.9);
  color: var(--olive);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.btn-block {
  width: 100%;
}

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

/* ── Form Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.field-input {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: var(--white);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color var(--duration-fast) ease;
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-muted);
}

.field-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

.field-error {
  font-size: 0.8rem;
  color: var(--error);
  display: none;
}

.field-error.visible {
  display: block;
}

/* ── Radio Options ── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.85rem 1.1rem;
  background: var(--white);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.radio-option:hover {
  border-color: var(--sage);
}

.radio-option input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--cream-dark);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all var(--duration-fast) ease;
}

.radio-option input[type="radio"]:checked {
  border-color: var(--sage);
  background: var(--sage);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
}

.radio-option input[type="radio"]:focus-visible {
  box-shadow: 0 0 0 3px var(--sage-muted);
}

.radio-option span {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* ── Honeypot (anti-spam) ── */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ── Loading Spinner ── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: var(--space-sm);
}

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

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sage-muted), transparent);
}

.divider-icon {
  color: var(--sage);
  font-size: 1.2rem;
}

/* ── Alert / Message ── */
.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: none;
}

.alert.visible {
  display: block;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(192, 57, 43, 0.15);
}
