/* VoxTale Auth — Woodland Storybook Theme */

:root {
  --parchment: #FDF8F3;
  --warm-cream: #F5E6D3;
  --story-brown: #3E2723;
  --story-brown-light: #4E342E;
  --woodland-green: #4A7C59;
  --warm-amber: #D4A574;
  --deep-forest: #2D5016;
  --error-red: #C62828;
  --success-green: #2E7D32;
  --border-color: #D7CCC8;
  --shadow: rgba(62, 39, 35, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: var(--parchment);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(212, 165, 116, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(74, 124, 89, 0.05) 0%, transparent 50%);
  color: var(--story-brown);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.6;
}

/* Logo & Header */
.auth-header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.auth-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--story-brown);
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.auth-header h1 span {
  color: var(--woodland-green);
}

.auth-header .tagline {
  font-size: 1rem;
  color: var(--story-brown-light);
  font-style: italic;
}

/* Card Container */
.auth-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px var(--shadow);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  margin: 1.5rem 1rem;
}

.auth-card h2 {
  font-size: 1.5rem;
  color: var(--story-brown);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--story-brown-light);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--story-brown);
  background: var(--parchment);
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--woodland-green);
}

.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--story-brown);
  background: var(--parchment);
  appearance: none;
}

/* Buttons */
.btn {
  display: inline-block;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

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

.btn-primary {
  background: var(--woodland-green);
  color: white;
}

.btn-primary:hover {
  background: #3d6a4b;
}

.btn-secondary {
  background: var(--warm-amber);
  color: var(--story-brown);
}

.btn-sso {
  background: var(--story-brown);
  color: var(--parchment);
  margin-top: 0.75rem;
}

.btn-sso:hover {
  background: var(--story-brown-light);
}

/* Consent checkbox */
.consent-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.consent-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--woodland-green);
  flex-shrink: 0;
}

.consent-group label {
  font-size: 0.85rem;
  color: var(--story-brown-light);
  line-height: 1.5;
}

/* Links */
.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.auth-links a {
  color: var(--woodland-green);
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Error/Success Messages */
.message {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}

.message.error {
  background: #FFEBEE;
  color: var(--error-red);
  border: 1px solid #EF9A9A;
}

.message.success {
  background: #E8F5E9;
  color: var(--success-green);
  border: 1px solid #A5D6A7;
}

.message.visible {
  display: block;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  gap: 1rem;
}

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

.divider span {
  font-size: 0.8rem;
  color: var(--story-brown-light);
  font-style: italic;
}

/* ===== Profile Selector ===== */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0;
}

.profile-card {
  background: var(--parchment);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.profile-card:hover {
  border-color: var(--woodland-green);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow);
}

.profile-card .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--warm-cream);
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.profile-card .name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--story-brown);
}

.profile-card.add-new {
  border-style: dashed;
  opacity: 0.7;
}

.profile-card.add-new:hover {
  opacity: 1;
}

.profile-card.add-new .avatar {
  font-size: 2rem;
  color: var(--woodland-green);
}

/* ===== PIN Pad ===== */
.pin-container {
  text-align: center;
  max-width: 360px;
  margin: 0 auto;
}

.pin-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--warm-cream);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border: 3px solid var(--warm-amber);
}

.pin-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--story-brown);
  margin-bottom: 1.5rem;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--warm-amber);
  background: transparent;
  transition: background 0.15s;
}

.pin-dot.filled {
  background: var(--woodland-green);
  border-color: var(--woodland-green);
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 280px;
  margin: 0 auto 1.5rem;
}

.pin-btn {
  width: 100%;
  aspect-ratio: 1;
  min-height: 65px;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  background: white;
  font-size: 1.75rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--story-brown);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pin-btn:hover {
  background: var(--warm-cream);
  border-color: var(--warm-amber);
}

.pin-btn:active {
  background: var(--warm-amber);
}

.pin-btn.backspace {
  font-size: 1.25rem;
}

/* ===== Avatar Selection ===== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

.avatar-option {
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  background: var(--parchment);
  transition: border-color 0.2s, background 0.2s;
}

.avatar-option:hover {
  border-color: var(--warm-amber);
}

.avatar-option.selected {
  border-color: var(--woodland-green);
  background: #E8F5E9;
}

.avatar-option .emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.25rem;
}

.avatar-option .label {
  font-size: 0.7rem;
  color: var(--story-brown-light);
  text-transform: capitalize;
}

/* Wide card for profile pages */
.auth-card.wide {
  max-width: 600px;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card {
    margin: 1rem 0.75rem;
    padding: 1.75rem;
  }

  .auth-header h1 {
    font-size: 2rem;
  }

  .avatar-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .profiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
