/* css/app.css — Flying Desk PWA */

:root {
  --color-primary:    #4F46E5;
  --color-primary-dk: #3730A3;
  --color-surface:    #ffffff;
  --color-bg:         #F5F5F7;
  --color-text:       #1C1C1E;
  --color-text-muted: #6B6B6B;
  --color-border:     #E0E0E5;
  --color-success:    #16A34A;
  --color-warning:    #D97706;
  --color-danger:     #DC2626;
  --radius:           12px;
  --radius-sm:        8px;
  --shadow:           0 1px 4px rgba(0,0,0,.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-surface:    #1C1C1E;
    --color-bg:         #000000;
    --color-text:       #F5F5F7;
    --color-text-muted: #8E8E93;
    --color-border:     #2C2C2E;
  }
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
#app { min-height: 100%; display: flex; flex-direction: column; }

.page { display: none; flex: 1; flex-direction: column; }
.page.active { display: flex; }

/* === Header === */
.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header h1 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.btn-icon {
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text);
  font-size: 18px;
}
.btn-icon:hover { background: var(--color-border); }

/* === Contenu principal === */
.main-content { flex: 1; overflow-y: auto; padding: 16px; max-width: 600px; margin: 0 auto; width: 100%; }

/* === Cards === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }

/* === Réservations === */
.booking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.booking-item:last-child { border-bottom: none; }
.booking-date { font-size: 13px; font-weight: 600; text-align: center; min-width: 44px; }
.booking-date .day { font-size: 22px; line-height: 1; }
.booking-info { flex: 1; }
.booking-info .slot { font-size: 15px; font-weight: 500; }
.booking-info .desk { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.booking-status { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.status-pending  { background: #FEF3C7; color: #92400E; }
.status-assigned { background: #D1FAE5; color: #065F46; }
@media (prefers-color-scheme: dark) {
  .status-pending  { background: #451A03; color: #FDE68A; }
  .status-assigned { background: #022C22; color: #6EE7B7; }
}
.btn-cancel { font-size: 12px; color: var(--color-danger); background: none; border: none; cursor: pointer; padding: 4px; }

/* === Formulaire === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text-muted); margin-bottom: 6px; }
.form-input, .form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus { border-color: var(--color-primary); }

/* === Boutons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
  width: 100%;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dk); }
.btn-ghost { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }

/* === Login screen === */
#page-login {
  align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 16px; }
.login-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.login-sub { color: var(--color-text-muted); margin-bottom: 32px; font-size: 15px; }

/* === Toast === */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #1C1C1E; color: #fff;
  padding: 10px 18px; border-radius: 20px;
  font-size: 14px; white-space: nowrap;
  opacity: 0; transition: opacity .2s;
  pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; }

/* === Bottom nav === */
.bottom-nav {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  position: sticky; bottom: 0;
  z-index: 10;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px 10px;
  font-size: 11px; font-weight: 500;
  color: var(--color-text-muted);
  background: none; border: none; cursor: pointer; gap: 3px;
  transition: color .15s;
}
.nav-item.active { color: var(--color-primary); }
.nav-icon { font-size: 22px; line-height: 1; }

/* === Vide === */
.empty-state { text-align: center; padding: 32px 16px; color: var(--color-text-muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 8px; }

/* === Loader === */
.loader { display: flex; justify-content: center; padding: 32px; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Profil === */
.profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; font-weight: 700;
}
.profile-name { font-size: 17px; font-weight: 600; }
.profile-email { font-size: 13px; color: var(--color-text-muted); }
