/* =============================================
   NUTRIO.LOVE - Auth & Wizard Styles
   ============================================= */

/* ================================
   AUTH PAGE LAYOUT
   ================================ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-branding {
  background: var(--bg-secondary);
  padding: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-branding::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--accent-primary) 0%, transparent 50%);
  opacity: 0.05;
}

.auth-branding-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 60px;
}

.auth-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.auth-branding-text h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
}

.auth-branding-text p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.auth-branding-stats {
  display: flex;
  gap: 40px;
}

.branding-stat {
  text-align: left;
}

.branding-stat .stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.branding-stat .stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ================================
   AUTH FORM CONTAINER
   ================================ */

.auth-form-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-primary);
}

.auth-form-wrapper {
  width: 100%;
  max-width: 400px;
}

.auth-lang {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-secondary);
}

/* ================================
   FORM ELEMENTS
   ================================ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.forgot-link {
  font-weight: 400;
  color: var(--accent-primary);
  font-size: 0.8rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--input-radius);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

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

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle.show .eye-open {
  display: none;
}

.password-toggle.show .eye-closed {
  display: block;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #ef4444;
  min-height: 18px;
}

/* Checkbox */
.form-checkbox {
  margin-top: 24px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkbox-label input {
  display: none;
}

.checkbox-mark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 2px;
}

.checkbox-label input:checked + .checkbox-mark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkbox-label input:checked + .checkbox-mark::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.checkbox-label a {
  color: var(--accent-primary);
}

/* ================================
   BUTTONS
   ================================ */

.auth-form .btn {
  margin-top: 8px;
}

.btn .btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.loading .btn-arrow {
  display: none;
}

.btn.loading .btn-loader {
  display: block;
}

.btn.loading span:first-child {
  opacity: 0.7;
}

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

/* ================================
   AUTH DIVIDER & ALT
   ================================ */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-alt {
  text-align: center;
}

.auth-alt p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-alt a {
  color: var(--accent-primary);
  font-weight: 600;
  margin-left: 4px;
}

.auth-footer {
  margin-top: 48px;
  text-align: center;
}

.auth-footer a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.auth-footer a:hover {
  color: var(--accent-primary);
}

/* ================================
   WIZARD PAGE
   ================================ */

.wizard-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-primary);
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
  flex-shrink: 0;
}

.wizard-header .auth-logo {
  margin-bottom: 0;
  font-size: 1.5rem;
}

.wizard-header .auth-logo .logo-icon {
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
}

.wizard-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 400px;
  margin: 0 40px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wizard-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ================================
   WIZARD CONTAINER - FIXED LAYOUT
   ================================ */

.wizard-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.wizard-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 400px;
}

/* ================================
   WIZARD NAVIGATION - ALWAYS BOTTOM
   ================================ */

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: 24px;
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.wizard-nav .btn-ghost {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.wizard-nav .btn-ghost svg {
  width: 18px;
  height: 18px;
}

.wizard-nav .btn-primary {
  min-width: 160px;
}

/* ================================
   WIZARD FOOTER
   ================================ */

.wizard-footer {
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.wizard-footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.wizard-footer a {
  color: var(--accent-primary);
  font-weight: 600;
  margin-left: 4px;
}

/* ================================
   WIZARD STEPS
   ================================ */

.wizard-step {
  display: none;
  animation: fadeSlideIn 0.4s ease;
}

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

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

.step-content {
  text-align: center;
  width: 100%;
}

.step-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.step-content h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.step-content > p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Step Form (for account step) */
.step-form {
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
}

.step-form .form-group {
  margin-bottom: 20px;
}

.step-form .form-checkbox {
  margin-top: 20px;
  margin-bottom: 0;
}

/* ================================
   OPTION CARDS
   ================================ */

.step-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.goal-options {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.goal-options .option-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gender-options {
  flex-direction: row;
  justify-content: center;
  gap: 16px;
}

.option-card {
  position: relative;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.goal-options .option-card {
  flex: 1 1 140px;
  max-width: 180px;
}

.gender-options .option-card {
  flex: 0 1 160px;
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  transition: all var(--transition-fast);
  height: 100%;
}

.option-card:hover .option-content {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

.option-card input:checked + .option-content {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  box-shadow: var(--shadow-glow);
}

.option-icon {
  font-size: 1.75rem;
}

.option-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* Horizontal Options (Activity) */
.option-horizontal .option-content {
  flex-direction: row;
  text-align: left;
  padding: 14px 16px;
  gap: 14px;
}

.option-horizontal .option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-horizontal .option-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.option-horizontal .option-title {
  font-size: 0.9rem;
}

.option-horizontal .option-desc {
  text-align: left;
}

.activity-options {
  max-width: 500px;
}

.activity-options .option-card {
  flex: none;
  width: 100%;
}

/* Gender Options */
.gender-options .option-content {
  min-width: 140px;
  padding: 24px 20px;
}

.gender-options .option-icon {
  font-size: 2.5rem;
}

.gender-options .option-title {
  font-size: 1rem;
}

/* ================================
   SLIDERS
   ================================ */

.step-slider {
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.slider-value {
  text-align: center;
  margin-bottom: 20px;
}

.slider-value span:first-child {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
}

.slider-value span:last-child {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.range-slider {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: var(--accent-gradient);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.range-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: var(--accent-gradient);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================================
   RESULTS STEP
   ================================ */

.results-step {
  padding: 0;
  width: 100%;
}

.results-header {
  margin-bottom: 32px;
}

.results-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.results-header h2 {
  font-size: 1.75rem;
}

.results-cards {
  margin-bottom: 24px;
}

.result-card.main-result {
  background: var(--accent-gradient);
  border-radius: 20px;
  padding: 28px 24px;
  margin-bottom: 16px;
  color: #fff;
  text-align: center;
}

.result-card .result-label {
  display: block;
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

.result-card .result-value {
  display: block;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.result-card .result-unit {
  font-size: 1.125rem;
  opacity: 0.9;
}

.results-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.macro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
}

.macro-card .macro-icon {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 6px;
}

.macro-card .macro-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.macro-card .macro-value::after {
  content: 'g';
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

.macro-card .macro-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Timeline */
.results-timeline {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.timeline-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.timeline-content {
  text-align: left;
  flex: 1;
}

.timeline-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.timeline-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.timeline-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.results-note {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 14px 16px;
}

.results-note p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1024px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  
  .auth-branding {
    display: none;
  }
  
  .auth-form-container {
    padding: 40px 20px;
  }
  
  .wizard-header {
    padding: 16px 20px;
  }
  
  .wizard-progress {
    margin: 0 16px;
    max-width: 300px;
  }
  
  .wizard-container {
    padding: 24px 20px;
  }
  
  .wizard-form {
    min-height: 350px;
  }
}

@media (max-width: 600px) {
  .step-content h2 {
    font-size: 1.5rem;
  }
  
  .step-content > p {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }
  
  .step-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }
  
  .step-form {
    max-width: 100%;
  }
  
  .step-form .form-group input {
    padding: 12px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .goal-options {
    flex-direction: column;
    gap: 10px;
  }
  
  .goal-options .option-card {
    flex: none;
    max-width: none;
    width: 100%;
  }
  
  .goal-options .option-content {
    flex-direction: row;
    padding: 16px;
    gap: 14px;
    text-align: left;
  }
  
  .goal-options .option-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
  }
  
  .goal-options .option-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
  }
  
  .goal-options .option-title {
    text-align: left;
  }
  
  .goal-options .option-desc {
    text-align: left;
  }
  
  .gender-options {
    flex-direction: row;
    gap: 12px;
  }
  
  .gender-options .option-card {
    flex: 1;
  }
  
  .gender-options .option-content {
    min-width: auto;
    width: 100%;
    padding: 20px 16px;
  }
  
  .gender-options .option-icon {
    font-size: 2rem;
  }
  
  .results-macros {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .macro-card {
    padding: 12px 8px;
  }
  
  .macro-card .macro-value {
    font-size: 1.25rem;
  }
  
  .slider-value span:first-child {
    font-size: 3rem;
  }
  
  .slider-value span:last-child {
    font-size: 1rem;
  }
  
  .step-slider {
    padding: 0 10px;
  }
  
  .slider-labels {
    font-size: 0.75rem;
  }
  
  .result-card .result-value {
    font-size: 3rem;
  }
  
  .wizard-nav {
    flex-direction: column-reverse;
    gap: 12px;
  }
  
  .wizard-nav .btn {
    width: 100%;
  }
  
  .wizard-nav .btn-ghost {
    justify-content: center;
  }
  
  .activity-options {
    gap: 8px;
  }
  
  .option-horizontal .option-content {
    padding: 12px 14px;
    gap: 12px;
  }
  
  .option-horizontal .option-icon {
    font-size: 1.25rem;
  }
  
  .option-horizontal .option-title {
    font-size: 0.85rem;
  }
  
  .option-horizontal .option-desc {
    font-size: 0.7rem;
  }
  
  .results-timeline {
    padding: 16px;
    gap: 12px;
  }
  
  .timeline-icon {
    font-size: 1.75rem;
  }
  
  .timeline-value {
    font-size: 1.1rem;
  }
}

/* Mobile Logo for Login */
.mobile-logo {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  text-decoration: none;
}

.mobile-logo .logo-icon {
  font-size: 2rem;
}

.mobile-logo .brand-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.mobile-logo .brand-dot {
  color: var(--accent-primary);
}

@media (max-width: 768px) {
  .mobile-logo {
    display: flex;
  }
}
