/* --- App typography & shell (Bootstrap 5.3 + Lexend / Inter) --- */
:root {
  --app-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --app-font-display: "Lexend", var(--app-font-body);
  --app-radius: 0.75rem;
  --app-radius-lg: 1rem;
  --bs-body-font-family: var(--app-font-body);
  --bs-border-radius-lg: var(--app-radius-lg);
}

.app-body {
  font-family: var(--app-font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.navbar-brand,
.page-intro h1 {
  font-family: var(--app-font-display);
  letter-spacing: -0.02em;
}

.font-display {
  font-family: var(--app-font-display);
  letter-spacing: -0.02em;
}

.card-accent-start {
  border: 0;
  box-shadow: var(--bs-box-shadow-sm), inset 4px 0 0 0 var(--card-accent-color, var(--bs-primary));
}

.card-accent-start--success {
  --card-accent-color: var(--bs-success);
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:hover {
  background-color: rgba(13, 110, 253, 0.08);
}

.app-navbar .navbar-toggler:focus {
  box-shadow: none;
}

.app-brand-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.app-content {
  max-width: 1100px;
}

.page-intro h1.brand-min {
  font-size: 1.5rem;
}

.auth-shell {
  max-width: 28rem;
  margin-inline: auto;
}

.auth-shell .card {
  border-radius: var(--app-radius-lg);
}

.auth-shell--wide {
  max-width: 36rem;
}

.auth-page-wrap {
  padding-top: 0.25rem;
  padding-bottom: 3rem;
  background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 42%, #f8fafc 100%);
  border-radius: 0;
  max-width: 100%;
}

@media (min-width: 576px) {
  .auth-page-wrap {
    border-radius: var(--app-radius-lg);
    margin-inline: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
}

.auth-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow:
    0 0.25rem 1rem rgba(15, 23, 42, 0.045),
    0 1rem 2.5rem rgba(15, 23, 42, 0.07);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, #6366f1 45%, #8b5cf6 100%);
  z-index: 1;
}

.auth-card-intro {
  text-align: center;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.auth-card-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-inline: auto;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.auth-card-title {
  font-family: var(--app-font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.45rem;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.auth-card-tagline {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.5;
  max-width: 22rem;
  margin-inline: auto;
  margin-bottom: 0;
}

.auth-field {
  border-color: #e2e8f0;
  padding: 0.65rem 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field:focus {
  border-color: rgba(13, 110, 253, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.form-control-lg.auth-field {
  padding: 0.75rem 1rem;
}

.auth-divider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
}

.auth-divider-row hr {
  flex: 1;
  margin: 0;
  opacity: 0.35;
  border-top-color: #cbd5e1;
}

.auth-divider-row span {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}

.auth-card .btn-primary {
  padding-block: 0.7rem;
  font-weight: 600;
}

.auth-footnote {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.45;
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 0;
}

.auth-switch a {
  color: var(--bs-primary);
}

.auth-back-home {
  text-align: center;
  margin-top: 1.75rem;
}

.auth-back-home a {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
}

.auth-back-home a:hover {
  color: var(--bs-primary);
}

.page-intro h1:empty {
  display: none;
}

.page-intro h1:empty + * {
  margin-top: 0;
}

.footer {
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* --- Timetable settings hub --- */
.settings-hub {
  width: 100%;
  max-width: none;
}

.settings-hub-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.settings-hub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.25rem;
  font-size: 0.875rem;
}

.settings-hub-meta a {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
}

.settings-hub-meta a:hover {
  color: var(--bs-primary);
}

.settings-hub-meta .meta-sep {
  color: #cbd5e1;
  user-select: none;
}

.settings-hub-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

a.settings-step {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--app-radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: #fff;
  padding: 1.15rem 1.35rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

@media (min-width: 576px) {
  a.settings-step {
    padding: 1.25rem 1.5rem;
  }
}

a.settings-step:hover {
  border-color: rgba(13, 110, 253, 0.28);
  box-shadow:
    0 0.5rem 1.5rem rgba(15, 23, 42, 0.07),
    0 0 0 1px rgba(13, 110, 253, 0.06);
  transform: translateY(-1px);
}

a.settings-step:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.45);
  outline-offset: 2px;
}

.settings-step-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.settings-step-chart {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.11) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.settings-step-body {
  flex: 1;
  min-width: 0;
}

.settings-step-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}

.settings-step-title {
  font-family: var(--app-font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.settings-step-desc {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 0;
}

.settings-step-aside {
  flex-shrink: 0;
  align-self: center;
  padding-left: 0.35rem;
}

.settings-step-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  font-size: 0.95rem;
  color: #64748b;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

a.settings-step:hover .settings-step-go {
  color: #fff;
  background: linear-gradient(155deg, #2563eb 0%, #4f46e5 100%);
  border-color: transparent;
  box-shadow: 0 0.35rem 1.1rem rgba(37, 99, 235, 0.38);
  transform: translateX(2px) scale(1.02);
}

a.settings-step:hover .settings-step-go i {
  transform: translateX(2px);
}

.settings-step-go i {
  transition: transform 0.22s cubic-bezier(0.33, 1, 0.68, 1);
}

a.settings-step:focus-visible .settings-step-go {
  outline: 2px solid rgba(13, 110, 253, 0.45);
  outline-offset: 2px;
}

a.settings-step:active .settings-step-go {
  transform: translateX(1px) scale(0.98);
}

/* --- Google sign-in --- */
.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: WHITE;
  background-image: none;
  border: 1px solid #747775;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  font-family: 'Roboto', arial, sans-serif;
  font-size: 14px;
  height: 40px;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 12px;
  position: relative;
  text-align: center;
  -webkit-transition: background-color .218s, border-color .218s, box-shadow .218s;
  transition: background-color .218s, border-color .218s, box-shadow .218s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
}

.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 12px;
  min-width: 20px;
  width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
  -webkit-flex-grow: 1;
  flex-grow: 1;
  font-family: 'Roboto', arial, sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
  -webkit-transition: opacity .218s;
  transition: opacity .218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.gsi-material-button:disabled {
  cursor: default;
  background-color: #ffffff61;
  border-color: #1f1f1f1f;
}

.gsi-material-button:disabled .gsi-material-button-contents {
  opacity: 38%;
}

.gsi-material-button:disabled .gsi-material-button-icon {
  opacity: 38%;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: #303030;
  opacity: 12%;
}

.gsi-material-button:not(:disabled):hover {
  -webkit-box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: #303030;
  opacity: 8%;
}

.gsi-material-button.gsi-material-button--full {
  max-width: none;
  width: 100%;
}

.gsi-material-button.gsi-material-button--full .gsi-material-button-content-wrapper {
  justify-content: center;
  gap: 0.75rem;
}

.text-label-overline {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* --- Landing (home) --- */
.home-landing {
  max-width: 1080px;
}

.home-hero {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 45%, #eef2ff 100%);
  color: var(--bs-body-color);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--app-radius-lg);
  padding: 2.25rem 1.75rem;
  box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.07);
}

@media (min-width: 992px) {
  .home-hero {
    padding: 3rem 2.75rem;
  }
}

.home-hero-badge {
  color: #155e75;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18) 0%, rgba(99, 102, 241, 0.16) 100%);
  border: 1px solid rgba(8, 145, 178, 0.28);
}

.home-hero-title {
  font-family: "Plus Jakarta Sans", var(--app-font-display), system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
  color: #0f172a;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .home-hero-title {
    color: transparent;
    background-image: linear-gradient(
      105deg,
      #0d9488 0%,
      #2563eb 32%,
      #7c3aed 65%,
      #db2777 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
  }
}

.home-hero-lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 38rem;
}

.home-hero-preview {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--app-radius);
  padding: 1.1rem 1.15rem;
  max-width: 22rem;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.06);
}

.home-preview-header {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.home-preview-grid {
  display: grid;
  grid-template-columns: auto repeat(4, 1fr);
  gap: 6px;
  font-size: 0.72rem;
  text-align: center;
  align-items: center;
  color: #334155;
}

.home-preview-grid > span:first-child {
  visibility: hidden;
}

.home-preview-rowlabel {
  color: #64748b;
  font-weight: 600;
  text-align: right;
  padding-right: 6px;
  font-variant-numeric: tabular-nums;
}

.home-slot {
  background: linear-gradient(180deg, #e0f2fe 0%, #dbeafe 100%);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #1e3a8a;
  border-radius: 6px;
  padding: 0.45rem 0.25rem;
  font-weight: 600;
}

.home-slot-accent {
  background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: rgba(5, 150, 105, 0.45);
  color: #065f46;
}

.home-slot-muted {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-weight: 500;
}

.home-preview-note {
  font-size: 0.7rem;
  color: #64748b;
  margin: 1rem 0 0;
  line-height: 1.4;
  font-family: var(--app-font-body);
  letter-spacing: 0;
}

.home-section-title {
  font-family: var(--app-font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.home-feature-hover {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-feature-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.1) !important;
}

.home-cta-banner {
  background: linear-gradient(120deg, #0f172a 0%, #1e40af 100%);
  border: none !important;
  box-shadow: 0 1rem 2.25rem rgba(30, 64, 175, 0.25);
}

.home-cta-banner .lead {
  color: rgba(255, 255, 255, 0.82);
}
