/* The Man Plan - Fitness Intake Specific Styles */
/* v2: Mobile-first redesign with OTP, loading states, improved touch targets */

/* ============================================
   PHONE VERIFICATION & OTP
   ============================================ */

.phone-verify-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.phone-verify-group .btn {
  white-space: nowrap;
}

.verify-hint {
  font-size: 0.8rem;
  color: var(--text-light);
}

.otp-input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.otp-input-group label {
  width: 100%;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.otp-input-group input {
  flex: 1;
  min-width: 120px;
}

.phone-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 14px;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
}

/* Small button variant */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
  color: var(--brand-white);
  font-size: 1rem;
  font-weight: 500;
}

/* ============================================
   MOBILE-FIRST INPUT IMPROVEMENTS
   ============================================ */

/* Ensure inputs don't trigger iOS zoom (font-size >= 16px) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="time"],
select {
  font-size: 16px;
}

/* Improved touch targets for mobile - min 48px height */
.radio-label,
.checkbox-label {
  min-height: 48px;
  padding: 12px 16px;
  align-items: center;
}

.radio-label input,
.checkbox-label input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Phone input specific */
.phone-input {
  letter-spacing: 0.5px;
}

/* ============================================
   WORKOUT DAYS GRID
   ============================================ */

.workout-days-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* ============================================
   TIER ASSIGNMENT DISPLAY
   ============================================ */

#tier-assignment {
  margin-bottom: 32px;
}

.tier-result {
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.tier-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.tier-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.tier-icon.level-1 {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.3) 0%, rgba(74, 222, 128, 0.1) 100%);
}

.tier-icon.level-2 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(251, 191, 36, 0.1) 100%);
}

.tier-icon.level-3 {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.3) 0%, rgba(230, 57, 70, 0.1) 100%);
}

.tier-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.tier-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
}

.tier-description {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tier-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tier-detail {
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
}

.tier-detail-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-detail-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   EXERCISE REVIEW
   ============================================ */

#exercise-review {
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  border: 1px solid var(--border);
}

.exercise-review-header {
  margin-bottom: 20px;
}

.exercise-review-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.exercise-review-header p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.day-preview {
  margin-bottom: 20px;
}

.day-label {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-type-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exercise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.exercise-item:hover {
  border-color: var(--primary);
}

.exercise-slot {
  width: 32px;
  height: 32px;
  background: var(--bg-input);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}

.exercise-slot.primary {
  background: var(--primary);
  color: var(--white);
}

.exercise-slot.accessory {
  background: var(--secondary);
  color: var(--white);
}

.exercise-content {
  flex: 1;
  min-width: 0;
}

.exercise-name {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.exercise-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

.exercise-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.exercise-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.exercise-action.substituted {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

/* ============================================
   REVIEW NOTE
   ============================================ */

.review-note {
  background: rgba(74, 144, 226, 0.1);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.review-note-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* ============================================
   SUBSTITUTION MODAL
   ============================================ */

#substitution-modal .modal-content {
  max-width: 480px;
}

#substitution-options {
  margin-top: 20px;
}

.substitute-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.substitute-option {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.substitute-option:hover {
  border-color: var(--primary);
}

.substitute-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.substitute-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.substitute-reason {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ============================================
   RESULTS SUMMARY FOR FITNESS
   ============================================ */

.fitness-summary {
  display: grid;
  gap: 16px;
}

.fitness-summary-card {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
}

.fitness-summary-card h3 {
  font-size: 0.875rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.fitness-summary-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.fitness-summary-card .detail {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 4px;
}

.ready-message {
  text-align: center;
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.1) 0%, rgba(74, 222, 128, 0.05) 100%);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius);
}

.ready-message h3 {
  color: var(--success);
  margin-bottom: 8px;
}

.ready-message p {
  color: var(--text-light);
}

/* ============================================
   SCORE BREAKDOWN (debug view)
   ============================================ */

.score-breakdown {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  font-size: 0.85rem;
}

.score-breakdown h4 {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.score-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.score-item:last-child {
  border-bottom: none;
  font-weight: 600;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid var(--border);
}

/* ============================================
   EQUIPMENT SUGGESTION ANIMATION
   ============================================ */

.equipment-suggestion {
  animation: slideIn 0.3s ease-out;
}

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

/* ============================================
   MOBILE-FIRST FORM NAVIGATION
   ============================================ */

.form-navigation {
  flex-direction: column;
  gap: 12px;
}

.form-navigation .btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

/* ============================================
   RESPONSIVE: MOBILE (default, < 480px)
   ============================================ */

@media (max-width: 480px) {
  .tier-header {
    flex-direction: column;
    text-align: center;
  }

  .exercise-item {
    flex-wrap: wrap;
  }

  .exercise-action {
    width: 100%;
    text-align: center;
    padding: 10px;
    min-height: 44px;
  }

  .workout-days-grid {
    grid-template-columns: 1fr;
  }

  .otp-input-group {
    flex-direction: column;
  }

  .otp-input-group input {
    width: 100%;
  }
}

/* ============================================
   RESPONSIVE: TABLET (>= 768px)
   ============================================ */

@media (min-width: 768px) {
  .tier-details {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  #exercise-review {
    padding: 24px;
  }

  .exercise-item {
    padding: 12px 16px;
  }

  .form-navigation {
    flex-direction: row;
    justify-content: space-between;
  }

  .form-navigation .btn {
    width: auto;
    min-width: 120px;
  }
}

/* ============================================
   RESPONSIVE: DESKTOP (>= 1024px)
   ============================================ */

@media (min-width: 1024px) {
  .tier-details {
    grid-template-columns: repeat(3, 1fr);
  }
}
