/* ========================================
   innate - 본래의 나로 돌아가는 100일
   Global Styles
======================================== */

:root {
  /* Colors */
  --primary: #7C9A8E;
  --primary-dark: #5C7A6E;
  --primary-light: #A8C5B8;
  --secondary: #F5F0EB;
  --background: #FAFAFA;
  --surface: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --text-muted: #B2BEC3;
  --border: #DFE6E9;
  --error: #E17055;
  --success: #00B894;
  --warning: #FDCB6E;
  
  /* Typography */
  --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--surface);
  position: relative;
}

/* ========================================
   Typography
======================================== */
h1 { font-size: 28px; font-weight: 700; line-height: 1.3; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.4; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.4; }
p { font-size: 16px; line-height: 1.6; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-light); }
.text-center { text-align: center; }

/* ========================================
   Auth Pages (Login/Signup)
======================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xl);
  background: linear-gradient(180deg, var(--surface) 0%, var(--secondary) 100%);
}

.auth-header {
  text-align: center;
  padding: var(--spacing-2xl) 0;
}

.auth-logo { font-size: 48px; margin-bottom: var(--spacing-md); }
.auth-title { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: var(--spacing-sm); }
.auth-subtitle { font-size: 16px; color: var(--text-light); }

.auth-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

/* Floating Label Input */
.input-group {
  position: relative;
  margin-bottom: var(--spacing-md);
}

.input-group input {
  width: 100%;
  padding: var(--spacing-md) 0;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: border-color var(--transition-fast);
  outline: none;
}

.input-group input:focus { border-bottom-color: var(--primary); }

.input-group label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--transition-fast);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: -8px;
  transform: translateY(0);
  font-size: 12px;
  color: var(--primary);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover { background: var(--primary); color: white; }

/* Auth Footer */
.auth-footer { text-align: center; padding: var(--spacing-lg) 0; }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  color: var(--text-muted);
  font-size: 14px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ========================================
   Survey Page
======================================== */
.survey-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Progress Bar */
.progress-container {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}

.progress-bar {
  height: 6px;
  background: var(--secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-xs);
  font-size: 12px;
  color: var(--text-light);
}

/* Survey Content */
.survey-content {
  flex: 1;
  padding: var(--spacing-xl) var(--spacing-lg);
  display: flex;
  flex-direction: column;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.section-emoji { font-size: 32px; }
.section-title { font-size: 14px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; }

/* Question */
.question-container { animation: fadeInUp 0.3s ease; }

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

.question-text { font-size: 22px; font-weight: 600; line-height: 1.4; margin-bottom: var(--spacing-xl); color: var(--text); }
.question-subtitle { font-size: 14px; color: var(--text-light); margin-top: var(--spacing-sm); font-weight: 400; }

/* Options */
.options-list { display: flex; flex-direction: column; gap: var(--spacing-md); }

.option-card {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-card:hover { border-color: var(--primary-light); background: var(--secondary); }
.option-card.selected { border-color: var(--primary); background: rgba(124, 154, 142, 0.1); }

.option-radio {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  margin-right: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.option-card.selected .option-radio { border-color: var(--primary); background: var(--primary); }
.option-card.selected .option-radio::after { content: ''; width: 8px; height: 8px; background: white; border-radius: 50%; }

.option-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  margin-right: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.option-card.selected .option-checkbox { border-color: var(--primary); background: var(--primary); }
.option-card.selected .option-checkbox::after { content: '✓'; color: white; font-size: 14px; font-weight: bold; }

.option-text { font-size: 16px; color: var(--text); line-height: 1.4; }
.option-description { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* Other Input Field */
.other-input-container {
  margin-top: var(--spacing-md);
  animation: fadeIn 0.3s ease;
}

.other-input {
  width: 100%;
  padding: var(--spacing-md);
  font-size: 16px;
  font-family: var(--font-main);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast);
}

.other-input:focus {
  border-color: var(--primary);
}

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

/* Survey Navigation */
.survey-nav {
  padding: var(--spacing-lg);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--spacing-md);
}

.btn-back {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-light);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-back:hover { color: var(--text); background: var(--secondary); }

.btn-next {
  flex: 1;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.btn-next:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.btn-next:disabled { background: var(--text-muted); cursor: not-allowed; box-shadow: none; }

/* Survey Intro */
.survey-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--spacing-2xl);
}

.intro-emoji { font-size: 64px; margin-bottom: var(--spacing-md); }
.intro-brand { font-size: 36px; font-weight: 700; color: var(--primary); margin-bottom: var(--spacing-xs); letter-spacing: -1px; }
.intro-tagline { font-size: 15px; color: var(--text-light); margin-bottom: var(--spacing-lg); font-weight: 500; }
.intro-divider { width: 40px; height: 3px; background: var(--primary-light); border-radius: 2px; margin: 0 auto var(--spacing-lg); }
.intro-title { font-size: 24px; font-weight: 700; margin-bottom: var(--spacing-md); }
.intro-description { font-size: 16px; color: var(--text-light); margin-bottom: var(--spacing-xl); line-height: 1.8; }

.intro-features {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.intro-feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--secondary);
  border-radius: var(--radius-md);
  text-align: left;
}

.feature-icon { font-size: 24px; }
.feature-text { font-size: 14px; color: var(--text); }

/* Transition Screen */
.transition-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--spacing-xl);
  animation: fadeIn 0.3s ease;
}

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

.transition-card {
  background: var(--secondary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl) var(--spacing-lg);
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-sm);
}

.transition-text { 
  font-size: 17px; 
  color: var(--text); 
  line-height: 1.7; 
  margin-bottom: var(--spacing-lg);
  font-weight: 500;
}

.transition-progress {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.transition-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.transition-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.transition-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  min-width: 36px;
}

.transition-emoji { font-size: 48px; margin-bottom: var(--spacing-lg); }

/* Survey Complete */
.survey-complete {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--spacing-2xl);
}

.complete-emoji { font-size: 80px; margin-bottom: var(--spacing-lg); }
.complete-title { font-size: 28px; font-weight: 700; margin-bottom: var(--spacing-md); color: var(--primary); }
.complete-message { font-size: 16px; color: var(--text-light); margin-bottom: var(--spacing-xl); line-height: 1.6; }

/* Loading State */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

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

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

.loading-text { margin-top: var(--spacing-md); color: var(--text-light); }

/* Alert */
.alert { padding: var(--spacing-md); border-radius: var(--radius-md); font-size: 14px; margin-bottom: var(--spacing-md); }
.alert-error { background: rgba(225, 112, 85, 0.1); color: var(--error); border: 1px solid rgba(225, 112, 85, 0.3); }
.alert-success { background: rgba(0, 184, 148, 0.1); color: var(--success); border: 1px solid rgba(0, 184, 148, 0.3); }

/* Tab Navigation */
.tab-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding: var(--spacing-sm) 0;
  padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  transition: color var(--transition-fast);
}

.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 24px; margin-bottom: 2px; }

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (min-width: 481px) {
  .app-container { box-shadow: 0 0 40px rgba(0, 0, 0, 0.1); }
}
