@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');
@import url('variables.css');

/* ============================================================================
   Base
   ============================================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--tici-sand);
  color: var(--tici-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px; /* mobile bottom nav clearance */
}
a { color: var(--tici-aqua); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--tici-deep-water); margin: 0 0 .4rem; font-weight: 600; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
.mono { font-family: var(--font-mono); }
:focus-visible { outline: 3px solid var(--tici-driftwood); outline-offset: 2px; }
img { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Default icon size — prevents any icon() SVG without a specific size rule
   from falling back to the browser's default 300x150 replaced-element size. */
.icon-svg { width: 1em; height: 1em; flex-shrink: 0; }

/* ============================================================================
   Signature element: the waterline divider
   A wavy horizon motif standing in for an aquarium's water surface —
   used at the base of the hero and atop key cards.
   ============================================================================ */
.waterline {
  display: block;
  width: 100%;
  height: 28px;
  line-height: 0;
}
.waterline svg { width: 100%; height: 100%; display: block; }

/* ============================================================================
   Top navigation
   ============================================================================ */
.candidate-topbar {
  background: linear-gradient(135deg, var(--tici-deep-water) 0%, var(--tici-deep-water-2) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}
.candidate-topbar .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; max-width: 1180px; margin: 0 auto;
}
.candidate-topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.candidate-topbar .brand:hover { text-decoration: none; }
.candidate-topbar .brand .logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--tici-aqua);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.candidate-topbar .brand .brand-text { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: .2px; }
.candidate-topbar .brand .brand-text small { display: block; font-family: var(--font-body); font-size: .65rem; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; opacity: .7; }

.candidate-topbar nav.desktop-nav { display: none; }
.candidate-topbar nav.desktop-nav a {
  color: rgba(255,255,255,.82); font-size: .92rem; font-weight: 500; margin-left: 22px; padding: 6px 2px;
  border-bottom: 2px solid transparent; transition: border-color .2s var(--ease), color .2s var(--ease);
}
.candidate-topbar nav.desktop-nav a:hover, .candidate-topbar nav.desktop-nav a.active {
  color: #fff; text-decoration: none; border-bottom-color: var(--tici-driftwood);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--tici-aqua);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .82rem; border: 2px solid rgba(255,255,255,.3);
}
.topbar-bell { position: relative; color: #fff; font-size: 1.2rem; }
.topbar-bell .dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; background: var(--tici-driftwood); border-radius: 50%; border: 2px solid var(--tici-deep-water); }

.topbar-account { position: relative; }
.topbar-account-trigger { background: none; border: none; padding: 0; cursor: pointer; display: flex; line-height: 0; }
.topbar-account-menu {
  display: none; position: absolute; top: calc(100% + 12px); right: 0; min-width: 200px;
  background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-lifted);
  padding: 8px; z-index: 60; text-align: left;
}
.topbar-account.open .topbar-account-menu { display: block; }
.topbar-account-name { padding: 8px 10px 6px; font-size: .8rem; font-weight: 600; color: var(--tici-deep-water); border-bottom: 1px solid var(--tici-border); margin-bottom: 6px; }
.topbar-account-menu a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  font-size: .86rem; font-weight: 500; color: var(--tici-ink); white-space: nowrap;
}
.topbar-account-menu a svg { width: 16px; height: 16px; color: var(--tici-ink-soft); flex-shrink: 0; }
.topbar-account-menu a:hover { background: var(--tici-aqua-light); text-decoration: none; }
.topbar-account-menu a.logout-link { color: var(--tici-coral); }
.topbar-account-menu a.logout-link svg { color: var(--tici-coral); }

/* ============================================================================
   Mobile bottom nav (thumb-reach primary nav on phones/tablets)
   ============================================================================ */
.mobile-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--tici-border);
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 18px rgba(11,59,57,.08);
}
.mobile-bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--tici-ink-soft); font-size: .64rem; font-weight: 600; flex: 1; padding: 4px 0;
}
.mobile-bottom-nav a svg { width: 21px; height: 21px; }
.mobile-bottom-nav a.active { color: var(--tici-aqua); }
.mobile-bottom-nav a:hover { text-decoration: none; }

@media (min-width: 900px) {
  .candidate-topbar nav.desktop-nav { display: flex; align-items: center; }
  .mobile-bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ============================================================================
   Hero
   ============================================================================ */
.candidate-hero {
  background: linear-gradient(135deg, var(--tici-deep-water) 0%, var(--tici-deep-water-2) 65%, #145651 100%);
  color: #fff; padding: 34px 0 0;
}
.candidate-hero .container { padding-bottom: 26px; }
.candidate-hero .eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--tici-driftwood); }
.candidate-hero h1 { color: #fff; margin-top: 6px; }
.candidate-hero p.lede { color: rgba(255,255,255,.78); max-width: 60ch; margin: 0; }
.candidate-hero .waterline { margin-top: 22px; }
.candidate-hero .waterline path { fill: var(--tici-sand); }

/* ============================================================================
   Layout: page body sits on sand, cards float above
   ============================================================================ */
.page-body { padding: 8px 0 40px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: 1fr; }
.grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.layout-with-rail { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 980px) {
  .layout-with-rail { grid-template-columns: 2fr 1fr; align-items: start; }
}

/* ============================================================================
   Cards
   ============================================================================ */
.card {
  background: var(--tici-card); border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(11,59,57,.05);
}
.card.lifted { box-shadow: var(--shadow-lifted); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-header h2, .card-header h3 { margin: 0; }
.card-header .link-more { font-size: .85rem; font-weight: 600; white-space: nowrap; }

.stat-card { position: relative; overflow: hidden; padding: 18px 20px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--tici-deep-water); font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .78rem; color: var(--tici-ink-soft); margin-top: 6px; font-weight: 500; }
.stat-card .stat-icon {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; background: var(--tici-aqua-light); color: var(--tici-aqua);
}

/* ============================================================================
   Course card (My Courses grid)
   ============================================================================ */
.course-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.course-card .thumb {
  height: 130px; background: linear-gradient(135deg, var(--tici-moss) 0%, var(--tici-aqua) 100%);
  position: relative;
}
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card .thumb .level-tag {
  position: absolute; bottom: 10px; left: 14px; background: rgba(11,59,57,.55); color: #fff;
  font-size: .68rem; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(2px);
}
.course-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-card h3 { font-size: 1.05rem; }
.course-card .meta { display: flex; gap: 14px; font-size: .78rem; color: var(--tici-ink-soft); flex-wrap: wrap; }
.course-card .meta span { display: flex; align-items: center; gap: 5px; }

/* Tank-fill progress bar — signature progress treatment */
.tank-progress { background: var(--tici-aqua-light); border-radius: 20px; height: 10px; overflow: hidden; position: relative; }
.tank-progress .fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--tici-moss), var(--tici-aqua));
  transition: width .6s var(--ease);
}
.progress-row { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; color: var(--tici-ink-soft); margin-bottom: 6px; }
.progress-row .pct { font-family: var(--font-mono); font-weight: 600; color: var(--tici-deep-water); }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .88rem;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--tici-aqua); color: #fff; }
.btn-primary:hover { background: #166e62; box-shadow: 0 6px 16px rgba(27,133,119,.35); }
.btn-zoom { background: var(--tici-driftwood); color: #fff; }
.btn-zoom:hover { background: #a06f42; box-shadow: 0 6px 16px rgba(185,130,82,.35); }
.btn-outline { background: transparent; border-color: var(--tici-border); color: var(--tici-deep-water); }
.btn-outline:hover { border-color: var(--tici-aqua); background: var(--tici-aqua-light); }
.btn-ghost { background: transparent; color: var(--tici-ink-soft); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================================
   Badges / tags
   ============================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; text-transform: capitalize;
}
.badge-success { background: var(--tici-moss-light); color: #4d6b28; }
.badge-warning { background: var(--tici-amber-light); color: #8a5f0e; }
.badge-danger { background: var(--tici-coral-light); color: #9a382d; }
.badge-muted { background: #EEEAE0; color: var(--tici-ink-soft); }

/* ============================================================================
   Schedule / session list
   ============================================================================ */
.session-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--tici-border); margin-bottom: 10px; background: #fff;
}
.session-item .date-chip {
  flex-shrink: 0; width: 54px; height: 54px; border-radius: 12px; background: var(--tici-moss-light);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.session-item .date-chip .d { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--tici-deep-water); line-height: 1; }
.session-item .date-chip .m { font-size: .62rem; text-transform: uppercase; letter-spacing: .5px; color: var(--tici-ink-soft); margin-top: 2px; }
.session-item .info { flex: 1; min-width: 0; }
.session-item .info h4 { margin: 0 0 3px; font-size: .98rem; }
.session-item .info .time { font-family: var(--font-mono); font-size: .78rem; color: var(--tici-ink-soft); }
.session-item .action { flex-shrink: 0; }

/* ============================================================================
   Forms
   ============================================================================ */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--tici-deep-water); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--tici-border);
  font-family: var(--font-body); font-size: .92rem; color: var(--tici-ink); background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--tici-aqua); outline: none; box-shadow: 0 0 0 3px var(--tici-aqua-light); }
.hint { font-size: .74rem; color: var(--tici-ink-soft); margin-top: 4px; }
.field-error { font-size: .78rem; color: var(--tici-coral); margin-top: 4px; }

/* ============================================================================
   Alerts / flash
   ============================================================================ */
.alert { padding: 12px 16px; border-radius: 10px; font-size: .88rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: var(--tici-moss-light); color: #3d5a1f; }
.alert-danger { background: var(--tici-coral-light); color: #8a3126; }
.alert-warning { background: var(--tici-amber-light); color: #7a530c; }
.alert-info { background: var(--tici-aqua-light); color: #0e5a4e; }

/* ============================================================================
   Empty states
   ============================================================================ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--tici-ink-soft); }
.empty-state .icon { font-size: 2.4rem; margin-bottom: 10px; }

/* ============================================================================
   Auth pages (login/forgot password)
   ============================================================================ */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--tici-deep-water) 0%, var(--tici-deep-water-2) 55%, #0F4744 100%);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lifted); padding: 34px 30px; position: relative; overflow: hidden;
}
.auth-card .waterline { position: absolute; top: 0; left: 0; right: 0; height: 10px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .logo-mark {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 12px; background: var(--tici-aqua);
  display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
}
.auth-brand h1 { font-size: 1.3rem; margin-bottom: 2px; }
.auth-brand p { color: var(--tici-ink-soft); font-size: .85rem; margin: 0; }

/* ============================================================================
   Utility
   ============================================================================ */
.text-muted { color: var(--tici-ink-soft); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--tici-ink-soft); padding: 8px 10px; border-bottom: 2px solid var(--tici-border); }
table.data-table td { padding: 10px; border-bottom: 1px solid var(--tici-border); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
