/* ============================================================
   TutorsLink Custom Stylesheet
   Dark navy theme with yellow/pink/blue accents
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root,
html[data-theme="dark"] {
  --color-bg:         #0a0d14;
  --color-bg-card:    #111827;
  --color-bg-nav:     #080b11;
  --color-border:     #1e2a3a;
  --color-text:       #f8fafc;
  --color-text-muted: #cbd5e1;
  --color-yellow:     #FFD700;
  --color-pink:       #FF1493;
  --color-blue:       #007BFF;
  --color-white:      #ffffff;
  --font-main:        'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --radius:           12px;
  --shadow:           0 4px 24px rgba(0,0,0,0.5);
  --transition:       0.25s ease;
}

html[data-theme="light"] {
  --color-bg:         #f8fafc;
  --color-bg-card:    #ffffff;
  --color-bg-nav:     #ffffff;
  --color-border:     #e2e8f0;
  --color-text:       #0f172a;
  --color-text-muted: #475569;
  --color-yellow:     #ca8a04;
  --color-pink:       #db2777;
  --color-blue:       #2563eb;
  --color-white:      #0f172a;
  --shadow:           0 4px 24px rgba(15, 23, 42, 0.08);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #6a0dad, #0a0d14);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

html[data-theme="light"] body {
  background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 45%, #f1f5f9 100%);
}

a {
  color: var(--color-yellow);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-pink);
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Navigation ---------- */
.tl-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-bg-nav);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.25rem;
  min-height: 64px;
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .tl-nav {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.tl-nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-white);
  text-decoration: none;
}

.tl-nav__logo-icon {
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, var(--color-yellow) 0%, #e6a800 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tl-nav__logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Two-line nav label: "Apply as" / "Tutor" */
.tl-nav__link--stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.18;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.tl-nav__link--stack .tl-nav__link-line {
  display: block;
}

.tl-theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}

html[data-theme="light"] .tl-theme-toggle {
  background: #f1f5f9;
}

.tl-theme-toggle:hover {
  border-color: var(--color-yellow);
}

.tl-nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 1.2vw, 1.25rem);
  list-style: none;
  flex: 1;
  justify-content: center;
  min-width: 0;
  margin: 0 0.25rem;
}

@media (min-width: 769px) {
  .tl-nav__links {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  }
}

.tl-nav__links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}

.tl-nav__links a:hover,
.tl-nav__links a.active {
  color: var(--color-yellow);
}

.tl-nav__cta {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(100%, 420px);
}

.tl-nav__cta .btn {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
}

.tl-nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.tl-nav__hamburger span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-yellow);
  color: #000;
  border-color: var(--color-yellow);
}

.btn-primary:hover {
  background: #e6c200;
  border-color: #e6c200;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--color-pink);
  border-color: var(--color-pink);
}

.btn-secondary:hover {
  background: var(--color-pink);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-yellow);
  color: var(--color-yellow);
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

/* ---------- Hero Section ---------- */
.tl-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #040608 0%, #0a0d14 40%, #0d1a2e 70%, #0a0d14 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 3rem;
  position: relative;
  overflow: hidden;
}

.tl-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,215,0,0.04) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(255,20,147,0.05) 0%, transparent 40%),
              radial-gradient(ellipse at 80% 20%, rgba(0,123,255,0.05) 0%, transparent 40%);
  pointer-events: none;
}

.tl-hero__logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  background: transparent;
  border-radius: 50%;
  animation: pulse-glow 3s ease-in-out infinite;
}

.tl-hero__logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 50%;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255,215,0,0.35)); }
  50%       { filter: drop-shadow(0 0 32px rgba(255,215,0,0.55)); }
}

html[data-theme="light"] .tl-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

html[data-theme="light"] .tl-hero__headline {
  color: var(--color-text);
}

.tl-hero__brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-yellow);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.tl-hero__headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-white);
  max-width: 700px;
  margin: 0 auto 1rem;
  position: relative;
  z-index: 1;
}

.tl-hero__headline span {
  background: linear-gradient(90deg, var(--color-yellow), var(--color-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tl-hero__subheading {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  position: relative;
  z-index: 1;
}

.tl-hero__ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.tl-hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  animation: bounce 2s infinite;
  z-index: 1;
}

.tl-hero__scroll-hint::after {
  content: '▼';
  font-size: 1rem;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ---------- Sections ---------- */
.tl-section {
  padding: 5rem 2rem;
}

.tl-section--alt {
  background: rgba(17, 24, 39, 0.5);
}

.tl-section__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.tl-section__tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--color-yellow);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.tl-section__title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.75rem;
}

.tl-section__desc {
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* ---------- Why Us Grid ---------- */
.tl-why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.tl-why-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.tl-why-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-yellow);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.12);
}

.tl-why-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tl-why-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.tl-why-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ---------- Carousel ---------- */
.tl-carousel-wrap {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.tl-carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0.5rem 0 1rem;
  cursor: grab;
}

.tl-carousel::-webkit-scrollbar {
  display: none;
}

.tl-carousel.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.tl-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition);
  font-size: 1rem;
}

.tl-carousel__arrow:hover {
  background: var(--color-yellow);
  color: #000;
  border-color: var(--color-yellow);
}

.tl-carousel__arrow--prev { left: -20px; }
.tl-carousel__arrow--next { right: -20px; }

/* ---------- Tutor Cards ---------- */
.tl-tutor-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.tl-tutor-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-yellow);
  box-shadow: var(--shadow);
}

.tl-tutor-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #000;
  margin: 0 auto 1rem;
}

.tl-tutor-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 0.25rem;
}

.tl-tutor-card__subject {
  font-size: 0.85rem;
  color: var(--color-yellow);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
}

.tl-tutor-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

.tl-tutor-card__rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--color-yellow);
  margin-bottom: 1rem;
  justify-content: center;
}

.tl-tutor-card__btn {
  width: 100%;
  justify-content: center;
}

/* ---------- Feature Cards ---------- */
.tl-feature-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.tl-feature-card:hover,
.tl-feature-card.expanded {
  border-color: var(--color-pink);
  box-shadow: 0 8px 30px rgba(255,20,147,0.12);
}

.tl-feature-card.expanded {
  flex: 0 0 420px;
}

.tl-feature-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.tl-feature-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.4rem;
}

.tl-feature-card__short {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.tl-feature-card__full {
  display: none;
  font-size: 0.88rem;
  color: var(--color-text);
  margin-top: 1rem;
  line-height: 1.7;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.tl-feature-card.expanded .tl-feature-card__full {
  display: block;
}

.tl-feature-card__toggle {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--color-pink);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ---------- Tiles Grid ---------- */
.tl-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.tl-tile {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.tl-tile:hover {
  transform: translateY(-4px);
  text-decoration: none;
}

.tl-tile--yellow:hover  { border-color: var(--color-yellow); box-shadow: 0 8px 30px rgba(255,215,0,0.12); }
.tl-tile--pink:hover    { border-color: var(--color-pink);   box-shadow: 0 8px 30px rgba(255,20,147,0.12); }
.tl-tile--blue:hover    { border-color: var(--color-blue);   box-shadow: 0 8px 30px rgba(0,123,255,0.12); }

.tl-tile__icon {
  font-size: 2.2rem;
}

.tl-tile__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
}

.tl-tile__desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.tl-tile__arrow {
  margin-top: auto;
  font-size: 1.2rem;
}

.tl-tile--yellow .tl-tile__arrow { color: var(--color-yellow); }
.tl-tile--pink .tl-tile__arrow   { color: var(--color-pink); }
.tl-tile--blue .tl-tile__arrow   { color: var(--color-blue); }

/* ---------- Ads / Announcements Grid ---------- */
.tl-ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.tl-ad-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tl-ad-card:hover {
  border-color: var(--color-yellow);
  box-shadow: 0 8px 30px rgba(255,215,0,0.1);
}

.tl-ad-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tl-ad-card__body {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
}

.tl-ad-card__date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: auto;
}

/* ---------- Modal ---------- */
.tl-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.tl-modal-overlay.open {
  display: flex;
}

.tl-modal {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.tl-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.tl-modal__close:hover {
  border-color: var(--color-pink);
  color: var(--color-pink);
}

.tl-modal__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: #000;
  margin: 0 auto 1rem;
}

.tl-modal__name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
}

.tl-modal__subject {
  color: var(--color-yellow);
  text-align: center;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.tl-modal__meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tl-modal__meta-item {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 0.75rem;
}

.tl-modal__meta-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.tl-modal__meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-white);
}

.tl-modal__bio {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.tl-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tl-tag {
  padding: 0.3rem 0.75rem;
  background: rgba(0,123,255,0.1);
  border: 1px solid rgba(0,123,255,0.3);
  color: var(--color-blue);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}

.tl-modal__actions {
  display: flex;
  gap: 0.75rem;
}

.tl-modal__actions .btn {
  flex: 1;
  justify-content: center;
}

/* ---------- Form Styles ---------- */
.tl-form-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.tl-form-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.tl-form-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-yellow);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tl-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tl-form-grid--single {
  grid-template-columns: 1fr;
}

.tl-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tl-form-group--full {
  grid-column: 1 / -1;
}

.tl-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.tl-form-group label .required {
  color: var(--color-pink);
  margin-left: 2px;
}

.tl-form-group input,
.tl-form-group select,
.tl-form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  transition: border-color var(--transition);
  outline: none;
  width: 100%;
}

.tl-form-group input:focus,
.tl-form-group select:focus,
.tl-form-group textarea:focus {
  border-color: var(--color-yellow);
  box-shadow: 0 0 0 3px rgba(255,215,0,0.1);
}

.tl-form-group input::placeholder,
.tl-form-group textarea::placeholder {
  color: rgba(148,163,184,0.5);
}

.tl-form-group select option {
  background: var(--color-bg-card);
  color: var(--color-text);
}

.tl-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.tl-form-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.tl-commission-box {
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.tl-commission-box h4 {
  color: var(--color-yellow);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.tl-commission-box p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.tl-commission-box ul {
  margin: 0.5rem 0 0 1.2rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.tl-commission-box li {
  margin-bottom: 0.25rem;
}

.tl-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.tl-checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--color-yellow);
  cursor: pointer;
}

.tl-checkbox-group label {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  cursor: pointer;
}

/* ---------- Chat UI ---------- */
.tl-chat-container {
  max-width: 760px;
  margin: 0 auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 560px;
  overflow: hidden;
}

.tl-chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(255,215,0,0.06);
  border-bottom: 1px solid var(--color-border);
}

.tl-chat-header__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tl-chat-header__info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-white);
}

.tl-chat-header__info p {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tl-chat-header__info p::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}

.tl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.tl-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.tl-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.tl-chat-messages::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.tl-chat-msg {
  display: flex;
  gap: 0.6rem;
  max-width: 80%;
}

.tl-chat-msg--system {
  max-width: 100%;
  justify-content: center;
}

.tl-chat-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.tl-chat-msg__bubble {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.tl-chat-msg--staff .tl-chat-msg__bubble {
  background: rgba(255,255,255,0.06);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

.tl-chat-msg--user .tl-chat-msg__bubble {
  background: var(--color-yellow);
  color: #000;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.tl-chat-msg--system .tl-chat-msg__bubble {
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-style: italic;
}

.tl-chat-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  align-self: flex-end;
}

.tl-chat-msg__time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  align-self: flex-end;
  white-space: nowrap;
}

.tl-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: rgba(255,255,255,0.02);
}

.tl-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
  outline: none;
  transition: border-color var(--transition);
  resize: none;
  max-height: 120px;
  min-height: 42px;
}

.tl-chat-input:focus {
  border-color: var(--color-yellow);
}

.tl-chat-send {
  background: var(--color-yellow);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.tl-chat-send:hover {
  background: #e6c200;
  transform: scale(1.05);
}

.tl-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.tl-chat-typing {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  padding: 0 1.25rem 0.5rem;
  min-height: 24px;
}

.tl-chat-typing span {
  display: flex;
  gap: 3px;
}

.tl-chat-typing span i {
  width: 5px;
  height: 5px;
  background: var(--color-text-muted);
  border-radius: 50%;
  animation: typing-dot 1.2s infinite;
  font-style: normal;
  display: inline-block;
}

.tl-chat-typing span i:nth-child(2) { animation-delay: 0.2s; }
.tl-chat-typing span i:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-4px); opacity: 1; }
}

/* ---------- About Page ---------- */
.tl-about-intro {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.tl-about-intro p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.tl-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  counter-reset: step;
}

.tl-step {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
}

.tl-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: var(--color-yellow);
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 32px;
  text-align: center;
}

.tl-step__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.tl-step__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.tl-step__desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.tl-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.tl-benefit-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
}

.tl-benefit-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tl-benefit-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tl-benefit-card ul li {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.5;
}

.tl-benefit-card ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-yellow);
  font-weight: 700;
}

/* ---------- Footer ---------- */
.tl-footer {
  background: var(--color-bg-nav);
  border-top: 1px solid var(--color-border);
  padding: 3rem 2rem 2rem;
}

.tl-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
}

.tl-footer__brand p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
  max-width: 260px;
}

.tl-footer__col h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tl-footer__col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tl-footer__col ul li a {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.tl-footer__col ul li a:hover {
  color: var(--color-yellow);
}

.tl-footer__bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------- Alert / Toast ---------- */
.tl-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
  box-shadow: var(--shadow);
  z-index: 3000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 320px;
}

.tl-toast.show {
  transform: translateX(0);
}

.tl-toast--success {
  border-left: 4px solid #22c55e;
}

.tl-toast--error {
  border-left: 4px solid var(--color-pink);
}

.tl-toast--info {
  border-left: 4px solid var(--color-blue);
}

/* ---------- Page Header (inner pages) ---------- */
.tl-page-header {
  background: linear-gradient(135deg, #040608 0%, #0a0d14 60%, #0d1a2e 100%);
  padding: 7rem 2rem 4rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

html[data-theme="light"] .tl-page-header {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.tl-page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: 0.75rem;
}

.tl-page-header p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* ---------- Utilities ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
}

.text-yellow { color: var(--color-yellow); }
.text-pink   { color: var(--color-pink); }
.text-blue   { color: var(--color-blue); }
.text-muted  { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tl-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .tl-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .tl-nav__links,
  .tl-nav__cta {
    display: none;
  }

  .tl-nav__hamburger {
    display: flex;
  }

  /* One flowing menu: logo + hamburger row, then links, then auth (no overlapping panels) */
  .tl-nav.mobile-open {
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    padding-bottom: 0.75rem;
    max-height: 100vh;
    overflow-y: auto;
  }

  .tl-nav.mobile-open .tl-nav__logo {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
  }

  .tl-nav.mobile-open .tl-nav__hamburger {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
  }

  .tl-nav.mobile-open .tl-nav__links {
    order: 3;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: static;
    left: auto;
    right: auto;
    top: auto;
    background: var(--color-bg-nav);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.25rem 1rem;
    gap: 0.85rem;
    margin: 0;
    max-height: min(48vh, 360px);
    overflow-x: hidden;
    overflow-y: auto;
    mask-image: none;
    flex: none;
    justify-content: flex-start;
    align-items: stretch;
  }

  .tl-nav.mobile-open .tl-nav__links a {
    display: block;
    padding: 0.35rem 0;
    text-align: left;
  }

  .tl-nav.mobile-open .tl-nav__link--stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    font-size: 0.95rem;
    white-space: normal;
  }

  .tl-nav.mobile-open .tl-nav__cta {
    order: 4;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    position: static;
    left: auto;
    right: auto;
    top: auto;
    padding: 1rem 1.25rem 0.5rem;
    margin: 0;
    gap: 0.65rem;
    background: var(--color-bg-nav);
    border-bottom: 1px solid var(--color-border);
    flex-wrap: nowrap;
  }

  /* Same destinations already appear in the link list */
  .tl-nav.mobile-open .tl-nav__cta > a.btn {
    display: none !important;
  }

  .tl-nav.mobile-open .tl-nav__cta > #tl-auth-btn,
  .tl-nav.mobile-open .tl-nav__cta .tl-profile-icon,
  .tl-nav.mobile-open .tl-nav__cta #tl-theme-toggle {
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  .tl-nav.mobile-open .tl-nav__cta .tl-nav__profile-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .tl-nav.mobile-open .tl-nav__cta #tl-auth-status {
    width: 100%;
    text-align: center;
    white-space: normal;
  }

  .tl-form-grid {
    grid-template-columns: 1fr;
  }

  .tl-form-group--full {
    grid-column: 1;
  }

  .tl-carousel__arrow {
    display: none;
  }

  .tl-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .tl-footer__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tl-section {
    padding: 3.5rem 1.25rem;
  }

  .tl-tiles {
    grid-template-columns: 1fr;
  }

  .tl-hero__ctas {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .tl-hero__ctas .btn {
    width: 100%;
    justify-content: center;
    max-width: 300px;
  }
}
