/* PlayRep App — Base Styles */
/* Brand: Joyful Chaos */
/* Fonts: Young Serif (headings), Work Sans (body) */

:root {
  --coral: #FF6B6B;
  --coral-light: #FF8E8E;
  --coral-dark: #E85555;
  --sunshine: #FFE66D;
  --sunshine-light: #FFF0A3;
  --sky: #4ECDC4;
  --sky-light: #7EDDD6;
  --navy: #2C3E50;
  --cream: #FFF9F0;
  --mint: #A8E6CF;
  --charcoal: #2D3436;
  --white: #FFFFFF;
  --gray-100: #F7F7F7;
  --gray-200: #E8E8E8;
  --gray-300: #D0D0D0;
  --gray-400: #A0A0A0;
  --gray-500: #707070;
  --danger: #E74C3C;
  --success: #27AE60;

  --font-heading: 'Young Serif', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, sans-serif;
  --font-accent: 'Nothing You Could Do', cursive;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  min-height: 100dvh;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
}

/* ---- Layout ---- */

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100dvh;
}

.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---- App Header ---- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.app-header .logo-icon {
  width: 32px;
  height: 26px;
}

.app-header .logo-text {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--charcoal);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  width: 100%;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--coral-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--charcoal);
  border: 2px solid var(--gray-200);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--gray-300);
}

.btn-ghost {
  background: transparent;
  color: var(--coral);
  padding: 14px 16px;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.08);
}

.btn-small {
  font-size: 14px;
  padding: 10px 20px;
}

/* ---- Forms ---- */

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--charcoal);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

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

.form-input::placeholder {
  color: var(--gray-400);
}

.form-hint {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* ---- Cards ---- */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

/* ---- Checkbox / Toggle ---- */

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--coral);
  flex-shrink: 0;
}

.checkbox-row label {
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}

/* ---- Alert / Banner ---- */

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-warning {
  background: var(--sunshine-light);
  color: #856404;
  border: 1px solid #ffc107;
}

.alert-error {
  background: #fde8e8;
  color: var(--danger);
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* ---- Stepper (onboarding) ---- */

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 24px;
}

.stepper-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: all 0.3s;
}

.stepper-dot.active {
  background: var(--coral);
  width: 28px;
  border-radius: var(--radius-full);
}

.stepper-dot.done {
  background: var(--sky);
}

/* ---- Nav (bottom) ---- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
  padding: 4px 12px;
}

.nav-item.active {
  color: var(--coral);
  font-weight: 600;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

/* Nav icon: show filled version when active, outline when inactive */
.nav-item .nav-filled { display: none; }
.nav-item .nav-outline { display: block; }
.nav-item.active .nav-filled { display: block; }
.nav-item.active .nav-outline { display: none; }

/* ---- Utility ---- */

.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 14px; }
.text-coral { color: var(--coral); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ---- Loading spinner ---- */

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ---- Page transitions ---- */

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* ---- Scrollbar ---- */

body::-webkit-scrollbar { width: 0; }

/* ---- Safe area for bottom nav pages ---- */

.has-bottom-nav {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
