/**
 * Rezept-Bestellung - Stylesheet
 *
 * Design System:
 * - Primary Color: Teal/Türkis (#2f6b6d)
 * - Font: Inter (UI) + Playfair Display (Headings)
 * - Mobile-First: Max-width 420px
 * - 4-Step prescription order process
 *
 * @version 2.0.0
 * @author CodeNConcept
 */

/* ===================================
   CSS VARIABLES
   =================================== */
:root {
  /* Colors */
  --color-primary: #2f6b6d;
  --color-primary-light: #3d7f81;
  --color-secondary: #5a9b9d;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #6b7280;

  /* Backgrounds */
  --bg-gradient-start: #f0f8f8;
  --bg-gradient-end: #fafafa;
  --bg-card: white;
  --bg-input: linear-gradient(135deg, #f0f8f8 0%, #e8f3f3 100%);
  --bg-primary: linear-gradient(135deg, #2f6b6d 0%, #3d7f81 100%);

  /* Borders */
  --border-light: #e8f3f3;
  --border-medium: #5a9b9d;

  /* Typography */
  --font-primary: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Playfair Display', serif;

  /* Spacing */
  --container-max-width: 420px;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(47, 107, 109, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-selected: 0 8px 24px rgba(47, 107, 109, 0.25);
  --shadow-button: 0 8px 24px rgba(47, 107, 109, 0.25), 0 2px 6px rgba(47, 107, 109, 0.15);
  --shadow-button-hover: 0 12px 32px rgba(47, 107, 109, 0.3), 0 4px 8px rgba(47, 107, 109, 0.2);
  --shadow-nav: 0 -4px 20px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
}

/* ===================================
   RESET & BASE STYLES
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text-primary);
  background: linear-gradient(to bottom, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===================================
   LAYOUT - Container
   =================================== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--spacing-md);
  padding-bottom: 100px; /* Space for fixed footer */
}

/* ===================================
   COMPONENTS - Header
   =================================== */
.header {
  text-align: center;
  padding: var(--spacing-lg) 0 var(--spacing-xl);
}

.practice-name {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}

.tagline {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-secondary);
}

/* ===================================
   COMPONENTS - Back Link
   =================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: var(--spacing-lg);
  transition: var(--transition-fast);
}

.back-link:hover {
  color: var(--color-primary);
}

/* ===================================
   COMPONENTS - Progress Bar
   =================================== */
.progress-wrapper {
  margin-bottom: var(--spacing-xl);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.progress-step {
  flex: 1;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 0 var(--spacing-xs);
  transition: var(--transition-smooth);
}

.progress-step.active {
  background: var(--bg-primary);
  box-shadow: 0 2px 8px rgba(47, 107, 109, 0.3);
}

.progress-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
}

/* ===================================
   COMPONENTS - Step Card
   =================================== */
.step-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.25rem var(--spacing-lg);
  box-shadow: var(--shadow-card);
  min-height: 320px;
  display: none;
}

.step-card.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

.step-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.01em;
}

.step-subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-bottom: var(--spacing-md);
}

/* ===================================
   COMPONENTS - Option Cards
   =================================== */
.option-grid {
  display: grid;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.option-card {
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.option-card:hover {
  border-color: var(--border-medium);
  transform: scale(1.02);
}

.option-card.selected {
  background: var(--bg-primary);
  border-color: transparent;
  box-shadow: var(--shadow-selected);
}

.option-card.selected .option-title,
.option-card.selected .option-desc {
  color: white;
}

.option-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0;
}

.option-desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ===================================
   COMPONENTS - Form Elements
   =================================== */
.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem var(--spacing-md);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--bg-input);
  transition: var(--transition-smooth);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  background: white;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 107, 109, 0.1);
}

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

/* ===================================
   COMPONENTS - Conditional Fields
   =================================== */
.conditional-fields {
  margin-top: var(--spacing-sm);
}

/* ===================================
   COMPONENTS - Navigation Buttons
   =================================== */
.nav-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: var(--spacing-md);
  box-shadow: var(--shadow-nav);
  z-index: 100;
}

.nav-buttons-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  padding: var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
}

.btn-back {
  background: white;
  color: var(--color-text-secondary);
  border: 2px solid var(--border-light);
}

.btn-back:hover {
  border-color: var(--border-medium);
  color: var(--color-primary);
}

.btn-next,
.btn-submit {
  background: var(--bg-primary);
  color: white;
  box-shadow: var(--shadow-button);
}

.btn-next:hover,
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-button-hover);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================================
   SECTION LABELS
   =================================== */
.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin: 1rem 0 0.5rem 0;
}

.section-label:first-child {
  margin-top: 0;
}

/* ===================================
   DATE INPUT FIX (iOS)
   =================================== */
input[type="date"] {
  max-width: 100%;
  background: var(--bg-input) !important;
  color: var(--color-text-primary);
  position: relative;
  -webkit-appearance: none;
  appearance: none;
}

/* Placeholder-Effekt für leere Date-Inputs */
input[type="date"]::-webkit-datetime-edit {
  color: var(--color-text-primary);
}

/* Wenn leer: Zeige Platzhalter */
input[type="date"]:invalid::-webkit-datetime-edit {
  color: transparent;
}

input[type="date"]:invalid::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  font-weight: 400;
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Wenn fokussiert oder ausgefüllt: Verstecke Platzhalter */
input[type="date"]:focus::before,
input[type="date"]:valid::before {
  display: none;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  position: relative;
  z-index: 1;
}
