/* ═══════════════════════════════════════════════════════
   TOULTRA GLOBAL COMPONENTS
   Universal Buttons, Inputs, Cards, and Badges.
   ═══════════════════════════════════════════════════════ */

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: all var(--transition-standard);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  min-height: var(--touch-min);
}

.btn-primary, .btn-gold {
  background: var(--gold);
  color: var(--surface-0);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover, .btn-gold:hover {
  background: var(--gold-bright);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

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

.btn-cream {
  background: var(--ink-primary);
  color: var(--surface-0);
}

.btn-cream:hover {
  background: #FFFFFF;
  transform: translateY(-1px);
}

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

.btn-ghost {
  border: 1px solid var(--border-standard);
  color: var(--ink-primary);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Button States */
.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn.loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── FORMS ─── */
.form-group {
  margin-bottom: var(--space-sm);
}

.label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}

.input, .textarea {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 16px; /* 16px prevents iOS zoom */
  line-height: 1.55;
  transition: border-color var(--transition-standard);
  min-height: var(--touch-min);
}

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

.input:focus, .textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 2px var(--gold-subtle);
}

.input::placeholder, .textarea::placeholder {
  color: var(--ink-quaternary);
}

.input.error {
  border-color: var(--error);
}

.input-message {
  font-size: 13px;
  margin-top: 6px;
  font-weight: 400;
}

.input-message.error {
  color: var(--error);
}

.input-message.success {
  color: var(--success);
}

/* ─── CARDS ─── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-standard), box-shadow var(--transition-standard);
}

.card:hover {
  border-color: var(--border-gold);
}

.premium-card {
  background: linear-gradient(180deg, rgba(26,26,26,0.6) 0%, rgba(20,20,20,0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 24px rgba(0,0,0,0.4);
  border-radius: var(--r-xl);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
}

.premium-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition-standard);
}

.premium-card:active::before {
  opacity: 1;
}

/* ─── BADGES & TAGS ─── */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  background: var(--gold-subtle);
  color: var(--gold);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

/* ─── ALERT BOXES ─── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.55;
  border-left: 3px solid transparent;
}

.alert-success {
  background: var(--success-bg);
  border-left-color: var(--success);
  color: var(--success);
}

.alert-error {
  background: var(--error-bg);
  border-left-color: var(--error);
  color: var(--error);
}

.alert-info {
  background: var(--info-bg);
  border-left-color: var(--info);
  color: var(--info);
}

/* ─── PROGRESS BARS ─── */
.progress-track {
  height: 6px;
  background: rgba(243, 239, 230, 0.06);
  border-radius: var(--r-full);
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ─── ACCESSIBILITY & FOCUS ─── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
