/* ============================================================
   YogaWala Portal — Design System
   Calm teal / sage meditation aesthetic
   ============================================================ */

:root {
  --ink: #1a2e2a;
  --ink-soft: #3d5a52;
  --muted: #6b857c;
  --paper: #f3f7f5;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --line: rgba(26, 46, 42, 0.12);
  --teal: #0f766e;
  --teal-deep: #0b4f4a;
  --sage: #7d9b8a;
  --mint: #c5ddd2;
  --sun: #d4a017;
  --danger: #b42318;
  --ok: #027a48;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(15, 60, 50, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  position: relative;
}

.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 0%, rgba(125, 155, 138, 0.22), transparent 50%),
    linear-gradient(180deg, #e8f2ee 0%, #f3f7f5 40%, #eef4f1 100%);
}

a {
  color: var(--teal-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(243, 247, 245, 0.82);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #e8f6f2, transparent 45%),
    conic-gradient(from 210deg, var(--teal), var(--sage), var(--mint), var(--teal-deep), var(--teal));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.78rem;
}

.primary-nav {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  flex-wrap: wrap;
}

.primary-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 550;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal-deep);
  text-decoration: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
}

.user-chip-name {
  font-weight: 600;
}

.user-chip-role {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-inner p {
  margin: 0.2rem 0;
}

/* Typography */
.page-hero {
  margin-bottom: 1.75rem;
  animation: rise 0.55s ease both;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  color: var(--ink);
}

.page-hero p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 42rem;
  font-size: 1.05rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
}

/* Campus tabs */
.campus-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  animation: rise 0.6s ease 0.05s both;
}

.campus-tab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.campus-tab:hover {
  background: rgba(15, 118, 110, 0.08);
}

.campus-tab.is-active {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}

.stat-block:nth-child(2) { animation-delay: 0.08s; }
.stat-block:nth-child(3) { animation-delay: 0.14s; }

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal-deep);
  line-height: 1.1;
}

.stat-hint {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Panels / layout */
.panel-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel + .panel,
.stack > * + * {
  margin-top: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.rank {
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 0.4rem;
}

.streak-fire {
  color: #c45c12;
  font-weight: 700;
}

/* Forms */
.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 720px;
}

.form-step {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--line);
}

.form-step:last-of-type {
  border-bottom: 0;
  margin-bottom: 1rem;
}

.step-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.35rem;
}

.form-step h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.field {
  margin-bottom: 0.9rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.rating-row,
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rating-row label,
.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rating-row input,
.checkbox-grid input {
  accent-color: var(--teal);
}

.rating-row label:has(input:checked),
.checkbox-grid label:has(input:checked) {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.1);
}

.quote-banner {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(125, 155, 138, 0.18));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  animation: rise 0.5s ease both;
}

.quote-banner blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
}

.quote-banner cite {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-style: normal;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.28);
}

.btn-primary:hover {
  background: var(--teal-deep);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--teal-deep);
  border: 1px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 0.4rem 0.7rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Profile */
.profile-header {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.5rem;
  animation: rise 0.55s ease both;
}

.avatar {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--teal), var(--sage));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.25);
}

.profile-meta h1 {
  font-family: var(--font-display);
  margin: 0 0 0.25rem;
  font-size: 2rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

.streak-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  background: rgba(212, 160, 23, 0.12);
  border: 1px solid rgba(212, 160, 23, 0.35);
  color: #8a5a00;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 700;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.badge-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  min-width: 160px;
}

.badge-chip .icon {
  font-size: 1.35rem;
}

.badge-chip strong {
  display: block;
  font-size: 0.92rem;
}

.badge-chip span {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Login */
.login-shell {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}

.login-card h1 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  font-size: 1.9rem;
}

.login-card .lead {
  color: var(--muted);
  margin: 0 0 1.4rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-error {
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #fecdca;
}

.alert-success {
  background: #ecfdf3;
  color: var(--ok);
  border: 1px solid #a6f4c5;
}

.alert-info {
  background: #eff8ff;
  color: #175cd3;
  border: 1px solid #b2ddff;
}

.empty-state {
  color: var(--muted);
  padding: 1rem 0;
  font-style: italic;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.toolbar .field {
  margin: 0;
  min-width: 160px;
}

.link-video {
  word-break: break-all;
  font-size: 0.85rem;
}

.loading {
  color: var(--muted);
  padding: 1.5rem 0;
}

/* Meditation media */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.media-card {
  background: linear-gradient(165deg, rgba(255,255,255,0.95), rgba(197,221,210,0.35));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.media-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.media-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
}

.media-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.media-duration {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.media-picker {
  display: grid;
  gap: 0.75rem;
}

.media-pick {
  display: block;
  cursor: pointer;
}

.media-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.media-pick-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.media-pick input:checked + .media-pick-body {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.08);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.media-pick-body strong {
  color: var(--teal-deep);
}

.media-pick-body small {
  color: var(--muted);
}

.media-open {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.habit-panel {
  background: linear-gradient(135deg, rgba(212, 160, 23, 0.08), rgba(15, 118, 110, 0.06));
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  border: 1px solid rgba(212, 160, 23, 0.25);
}

@media (max-width: 860px) {
  .stats-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .campus-tabs {
    border-radius: 16px;
  }

  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-inner {
    align-items: flex-start;
  }

  .user-chip {
    width: 100%;
  }
}
