/* ==========================================================================
   ROOT STUDIO GLOBAL — COMPONENTS (BUTTONS, FORMS, WIZARDS, AI FAB)
   ========================================================================== */

/* 1. Buttons & Action Elements */
.root-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-snap);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.root-btn-gold {
  background: linear-gradient(135deg, var(--root-gold) 0%, var(--root-gold-hover) 100%);
  color: var(--root-text-dark);
  box-shadow: 0 4px 18px var(--root-gold-glow);
}

.root-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.6);
  color: #000;
}

.root-btn-glass {
  background: rgba(18, 24, 33, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--root-border-glass);
  color: var(--root-text-white);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.root-btn-glass:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--root-cyan);
  color: var(--root-cyan);
  box-shadow: 0 0 25px var(--root-cyan-glow);
  transform: translateY(-2px);
}

.root-btn-danger {
  background: linear-gradient(135deg, #FF4757 0%, #FF6B81 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(255, 71, 87, 0.4);
}

.root-btn-danger:hover {
  box-shadow: 0 8px 25px rgba(255, 71, 87, 0.6);
  transform: translateY(-2px);
}

.root-btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

/* 2. Badges & Metrics Tags */
.root-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.root-badge-cyan {
  background: rgba(0, 240, 255, 0.1);
  color: var(--root-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.root-badge-gold {
  background: rgba(212, 175, 55, 0.1);
  color: var(--root-gold);
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.root-badge-danger {
  background: rgba(255, 71, 87, 0.12);
  color: #FF4757;
  border: 1px solid rgba(255, 71, 87, 0.35);
}

/* 3. Luxury Form Controls & Real-Time Validation */
.root-form-group {
  position: relative;
  margin-bottom: 22px;
  text-align: left;
}

.root-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--root-text-titanium);
  margin-bottom: 8px;
}

.root-label .req {
  color: var(--root-gold);
  margin-right: 4px;
}

.root-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.root-input,
.root-select,
.root-textarea {
  width: 100%;
  background: rgba(10, 16, 26, 0.85);
  border: 1px solid var(--root-border-glass);
  border-radius: var(--radius-md);
  color: var(--root-text-white);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 14px 16px;
  outline: none;
  transition: var(--transition-snap);
}

.root-input:focus,
.root-select:focus,
.root-textarea:focus {
  border-color: var(--root-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
  background: rgba(14, 22, 34, 0.95);
}

/* Validation States */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.root-form-group.has-error .root-input,
.root-form-group.has-error .root-select,
.root-form-group.has-error .root-textarea {
  border-color: var(--root-coral-danger) !important;
  box-shadow: 0 0 15px rgba(255, 71, 87, 0.35) !important;
  animation: inputShake 0.4s ease;
}

.field-error-hint {
  font-size: 0.78rem;
  color: #FF6B81;
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 6px;
}

.root-form-group.has-error .field-error-hint {
  display: flex;
}

.field-success-icon {
  position: absolute;
  right: 14px;
  color: var(--root-cyan);
  display: none;
}
.root-form-group.is-valid .field-success-icon {
  display: block;
}

/* 4. Multi-Step MRI Wizard */
.root-wizard-card {
  background: var(--root-card-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--root-border-glass);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 240, 255, 0.08);
  position: relative;
}

.root-wizard-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-bottom: 32px;
  overflow: hidden;
  position: relative;
}

.root-wizard-progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--root-cyan), var(--root-gold));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--root-cyan);
}

.root-wizard-steps-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}

.root-wizard-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  text-align: center;
}

.root-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(18, 24, 33, 0.9);
  border: 1px solid var(--root-border-glass);
  color: var(--root-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition-snap);
}

.root-wizard-step-node.active .root-step-circle {
  background: var(--root-cyan);
  color: var(--root-text-dark);
  border-color: var(--root-cyan);
  box-shadow: 0 0 15px var(--root-cyan-glow);
}

.root-wizard-step-node.completed .root-step-circle {
  background: var(--root-gold);
  color: var(--root-text-dark);
  border-color: var(--root-gold);
}

.root-step-title {
  font-size: 0.78rem;
  color: var(--root-text-muted);
  font-weight: 600;
}
.root-wizard-step-node.active .root-step-title {
  color: var(--root-text-white);
}

.root-wizard-step-panel {
  display: none;
}
.root-wizard-step-panel.active {
  display: block;
  animation: rootStepFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rootStepFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.root-wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 5. Floating AI Radial FAB Hub */
#root-ai-fab-hub {
  position: fixed;
  bottom: 30px;
  right: 30px;
  left: auto;
  z-index: 10000;
}

.root-fab-trigger {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(18, 24, 33, 0.95), rgba(5, 11, 20, 0.98));
  border: 1.5px solid var(--root-cyan);
  box-shadow: 0 0 25px var(--root-cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-snap);
}

.root-fab-trigger:hover {
  transform: scale(1.08) rotate(90deg);
  border-color: var(--root-gold);
  box-shadow: 0 0 35px var(--root-gold-glow);
}

.root-fab-menu {
  position: absolute;
  bottom: 74px;
  right: 0;
  left: auto;
  width: 290px;
  background: rgba(5, 11, 20, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--root-border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: var(--transition-snap);
}

#root-ai-fab-hub.is-open .root-fab-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.root-fab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--root-text-white);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-snap);
  margin-bottom: 4px;
}

.root-fab-item:hover {
  background: rgba(0, 240, 255, 0.1);
  color: var(--root-cyan);
  transform: translateX(-4px);
}

.root-fab-item.emergency {
  color: #FF6B81;
}
.root-fab-item.emergency:hover {
  background: rgba(255, 71, 87, 0.15);
  color: #FF4757;
}

@media (max-width: 768px) {
  #root-ai-fab-hub {
    bottom: 80px;
    right: 16px;
    left: auto;
  }
  .root-wizard-card {
    padding: 24px 16px;
  }
}
