/* ===========================
   Demo Form Styles
   =========================== */

.demo-form-section {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  padding: var(--spacing-xl) var(--spacing-sm);
  min-height: calc(100vh - 72px);
}

.form-header {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
}

.form-header h1 {
  font-size: 42px;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.form-header p {
  font-size: 18px;
  color: var(--text-secondary);
}

/* ===========================
   Progress Bar
   =========================== */
.progress-container {
  margin: 0 auto var(--spacing-xxl);
}

.progress-bar {
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #1e40af);
  width: 33.33%;
  transition: width 0.3s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.progress-step.active {
  opacity: 1;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: var(--border-color);
  color: var(--text-secondary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s ease;
}

.progress-step.active .step-number {
  background: linear-gradient(135deg, var(--primary-color), #1e40af);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37, 141, 218, 0.3);
}

.step-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.progress-step.active .step-label {
  color: var(--primary-color);
  font-weight: 600;
}

/* ===========================
   Form Container
   =========================== */
.demo-form {
  max-width: 700px;
  margin: 0 auto;
  background-color: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.form-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-step.active {
  display: block;
}

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

.form-step h2 {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.step-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* ===========================
   Form Groups
   =========================== */
.form-group {
  margin-bottom: var(--spacing-lg);
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  padding: var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  background-color: var(--white);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 141, 218, 0.1);
}

.form-group small {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   Admin and Trainer Cards
   =========================== */
.admin-card,
.trainer-card {
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  position: relative;
  transition: all 0.2s ease;
}

.admin-card:hover,
.trainer-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(37, 141, 218, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 16px;
  color: var(--text-primary);
  margin: 0;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-remove:hover {
  color: #c53030;
  transform: scale(1.2);
}

.btn-remove::before {
  content: "✕";
}

/* ===========================
   Add Buttons
   =========================== */
.btn-add-admin,
.btn-add-trainer {
  display: block;
  margin: var(--spacing-lg) 0;
  width: 100%;
  font-size: 14px;
}

/* ===========================
   Form Actions
   =========================== */
.form-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xxl);
  justify-content: flex-end;
}

.form-actions .btn {
  min-width: 160px;
}

.form-actions .btn-secondary {
  background-color: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.form-actions .btn-secondary:hover {
  background-color: #e2e8f0;
}

@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* ===========================
   Form Message
   =========================== */
.form-message {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  text-align: center;
  display: none;
  font-weight: 500;
  font-size: 15px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.form-message.loading {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
  display: block;
  animation: slideDown 0.3s ease, pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ===========================
   Responsive Adjustments
   =========================== */
@media (max-width: 768px) {
  .demo-form-section {
    padding: var(--spacing-lg) var(--spacing-sm);
  }

  .form-header h1 {
    font-size: 32px;
  }

  .form-header p {
    font-size: 16px;
  }

  .progress-steps {
    gap: var(--spacing-md);
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .step-label {
    font-size: 12px;
  }

  .demo-form {
    padding: var(--spacing-lg);
  }

  .form-step h2 {
    font-size: 22px;
  }
}

/* ===========================
   Confirmation Screen
   =========================== */
.confirmation-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--spacing-md);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.confirmation-screen.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.confirmation-content {
  background: white;
  border-radius: 16px;
  padding: var(--spacing-xxl);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

.confirmation-state {
  text-align: center;
}

.confirmation-state.hidden {
  display: none;
}

.confirmation-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-lg);
  background: #f0f9ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  stroke: var(--primary-color);
}

.confirmation-icon.success {
  background: #ecfdf5;
  color: #10b981;
  stroke: #10b981;
}

.confirmation-icon.error {
  background: #fef2f2;
  color: #ef4444;
  stroke: #ef4444;
}

.confirmation-icon svg {
  width: 48px;
  height: 48px;
}

.confirmation-state h2 {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.confirmation-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

.confirmation-details {
  background: #f8fafc;
  border-left: 4px solid var(--primary-color);
  padding: var(--spacing-lg);
  border-radius: 8px;
  margin-bottom: var(--spacing-xl);
  text-align: left;
}

.confirmation-details p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.6;
}

.confirmation-details p:last-child {
  margin-bottom: 0;
}

.confirmation-actions {
  display: flex;
  gap: var(--spacing-md);
  flex-direction: column;
}

.confirmation-actions .btn {
  flex: 1;
  padding: 12px 24px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

@media (min-width: 640px) {
  .confirmation-actions {
    flex-direction: row;
  }

  .confirmation-actions .btn {
    flex: 1;
  }
}

.confirmation-icon.error + h2 {
  color: #ef4444;
}

.confirmation-state.error .confirmation-details {
  border-left-color: #ef4444;
  background: #fef2f2;
}
