/* CSS Variables & Theming */
:root {
  /* Light Theme Colors */
  --bg-primary: #faf8f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f0eb;
  
  --text-primary: #2d2d2d;
  --text-secondary: #6b6b6b;
  --text-muted: #9a9a9a;
  
  --primary: #d46745;
  --primary-hover: #c45535;
  --primary-light: #f0d5cd;
  
  --accent-peach: #f4a89c;
  --accent-lavender: #c9b8d4;
  --accent-mint: #b8d4c9;
  --accent-yellow: #f4d89c;
  
  --border-color: #e8dfd7;
  --input-bg: #ffffff;
  --input-border: #e0d5cc;
  --input-focus: #d46745;
  
  --shadow-sm: 0 2px 8px rgba(212, 103, 69, 0.08);
  --shadow-md: 0 4px 16px rgba(212, 103, 69, 0.12);
  --shadow-lg: 0 8px 32px rgba(212, 103, 69, 0.16);
  
  --error-bg: #fdeae8;
  --error-text: #c53030;
  --error-border: #f5c6cb;
  
  --success-bg: #e8f5e9;
  --success-text: #2e7d32;
  --success-border: #a5d6a7;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-tertiary: #2d2d2d;
  
  --text-primary: #e8e8e8;
  --text-secondary: #b8b8b8;
  --text-muted: #888888;
  
  --primary: #e87856;
  --primary-hover: #f28969;
  --primary-light: #3d2f2a;
  
  --accent-peach: #d4897c;
  --accent-lavender: #a898b4;
  --accent-mint: #98b4a9;
  --accent-yellow: #d4b87c;
  
  --border-color: #3d3d3d;
  --input-bg: #2d2d2d;
  --input-border: #404040;
  --input-focus: #e87856;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  --error-bg: #3d2424;
  --error-text: #f08080;
  --error-border: #5d3838;
  
  --success-bg: #243d24;
  --success-text: #80c880;
  --success-border: #385d38;
}

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

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

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Disable tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* Common Box Styles */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.card-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.card-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none !important;
}

/* 2FA Code Input */
.code-input-container {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.code-input {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.code-input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(212, 103, 69, 0.1);
}

.code-input.error {
  border-color: var(--error-text);
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Responsive */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .card {
    padding: 1.25rem;
  }

  .code-input {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}
