/*
File: TaakBoard guest pages
Sign-in flow (parts/auth_page_top.php / auth_page_bottom.php), 404.php and the shared bits of landing.php
(the landing page's own styles are in landing.css).
Loaded after theme.css; uses its --tb-* tokens so light and dark both work.
*/

/* ============================================================
   Shared
   ============================================================ */
.tb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--tb-heading);
  text-decoration: none;
}
.tb-brand:hover { color: var(--tb-heading); }
.tb-brand img { width: auto; flex-shrink: 0; }
.tb-brand .font-brand { font-size: 1.4rem; font-weight: 700; line-height: 1; }

.tb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.15rem;
  color: var(--tb-muted);
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  border-radius: 10px;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.tb-icon-btn:hover { color: var(--tb-heading); background: var(--tb-surface-3); border-color: var(--tb-border-strong); }
.tb-icon-btn:focus-visible { outline: none; box-shadow: var(--tb-focus); border-color: var(--tb-brand); }

/* Alerts: readable text in light mode, icon + message layout */
:root[data-bs-theme=light] .tb-guest .alert-danger { --vz-alert-color: #b42318; --vz-alert-bg: #fef3f2; --vz-alert-border-color: #fecdca; }
:root[data-bs-theme=light] .tb-guest .alert-success { --vz-alert-color: #067647; --vz-alert-bg: #ecfdf3; --vz-alert-border-color: #abefc6; }
:root[data-bs-theme=light] .tb-guest .alert-info { --vz-alert-color: #175cd3; --vz-alert-bg: #eff8ff; --vz-alert-border-color: #b2ddff; }
.tb-guest .alert { border-width: 1px; font-size: 0.875rem; line-height: 1.45; }
.tb-alert { display: flex; align-items: flex-start; gap: 0.6rem; }
.tb-alert > i { font-size: 1.1rem; line-height: 1.25rem; flex-shrink: 0; }

/* ============================================================
   Sign-in flow
   ============================================================ */
.tb-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  background: var(--tb-surface);
}

/* Brand panel (large screens) */
.tb-auth-aside {
  display: none;
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(94, 234, 212, 0.28) 0%, transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(15, 23, 42, 0.45) 0%, transparent 60%),
    linear-gradient(160deg, #0f766e 0%, #115e59 55%, #134e4a 100%);
}
.tb-auth-aside::before {
  /* faint grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}
@media (min-width: 992px) {
  .tb-auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 0 0 46%;
    max-width: 620px;
    padding: 2.75rem 3rem;
  }
}
.tb-auth-aside > * { position: relative; }
.tb-auth-aside .tb-brand,
.tb-auth-aside .tb-brand:hover { color: #fff; }
.tb-auth-aside h2 {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}
.tb-auth-aside .tb-auth-lead { color: rgba(255, 255, 255, 0.78); font-size: 1rem; max-width: 30rem; margin-bottom: 2rem; }
.tb-auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.tb-auth-points li { display: flex; align-items: center; gap: 0.75rem; color: rgba(255, 255, 255, 0.92); font-weight: 500; }
.tb-auth-points i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 1rem;
  flex-shrink: 0;
}
.tb-auth-aside .tb-auth-copy { color: rgba(255, 255, 255, 0.6); font-size: 0.8125rem; margin: 0; }

/* Mini board illustration */
.tb-auth-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 420px;
  margin-top: 2.5rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.35);
}
.tb-auth-board > div { display: grid; gap: 0.5rem; align-content: start; }
.tb-auth-board span {
  display: block;
  height: 8px;
  width: 55%;
  margin-bottom: 0.15rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.45);
}
.tb-auth-board b {
  display: block;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  position: relative;
}
.tb-auth-board b::before,
.tb-auth-board b::after {
  content: "";
  position: absolute;
  left: 8px;
  height: 5px;
  border-radius: 99px;
  background: #cbd5e1;
}
.tb-auth-board b::before { top: 10px; width: 70%; background: #94a3b8; }
.tb-auth-board b::after { top: 22px; width: 40%; }
.tb-auth-board b.tb-dot-a::after { background: #2dd4bf; }
.tb-auth-board b.tb-dot-b::after { background: #fbbf24; }
.tb-auth-board b.tb-dot-c::after { background: #60a5fa; }

/* Form panel */
.tb-auth-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  background: var(--tb-surface);
}
@media (min-width: 576px) { .tb-auth-main { padding: 1.5rem 2rem; } }
.tb-auth-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; }
@media (min-width: 992px) { .tb-auth-top .tb-brand { visibility: hidden; } }
.tb-auth-body { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 2.5rem 0; }
.tb-auth-form { width: 100%; max-width: 400px; }
.tb-auth-foot { text-align: center; font-size: 0.8125rem; color: var(--tb-subtle); margin: 0; }
@media (min-width: 992px) { .tb-auth-foot { display: none; } }

.tb-auth-head { margin-bottom: 1.75rem; }
.tb-auth-head .tb-auth-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: var(--tb-brand-soft);
  color: var(--tb-brand-text);
  font-size: 1.4rem;
}
.tb-auth-head h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.tb-auth-head p { color: var(--tb-muted); margin: 0; font-size: 0.9375rem; }

.tb-auth .form-label { font-size: 0.875rem; margin-bottom: 0.4rem; }
.tb-auth .form-control {
  height: 44px;
  padding: 0.6rem 0.875rem;
  font-size: 0.9375rem;
  border-radius: 10px;
}
.tb-auth .form-check-label { color: var(--tb-text); font-size: 0.875rem; }
.tb-auth .btn-lg { height: 46px; font-size: 0.9375rem; font-weight: 600; border-radius: 10px; }
.tb-auth-link { color: var(--tb-brand-text); font-weight: 500; font-size: 0.875rem; text-decoration: none; }
.tb-auth-link:hover { color: var(--tb-brand-text); text-decoration: underline; }
.tb-auth-back { color: var(--tb-muted); font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.tb-auth-back:hover { color: var(--tb-heading); }
.tb-auth-divider { border-top: 1px solid var(--tb-border); margin: 1.75rem 0 1.25rem; }

/* ============================================================
   404
   ============================================================ */
.tb-error {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60% 50% at 50% 0%, var(--tb-brand-soft) 0%, transparent 70%),
    var(--tb-bg);
}
.tb-error-top { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1rem; }
@media (min-width: 576px) { .tb-error-top { padding: 1.5rem 2rem; } }
.tb-error-body { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem 3rem; text-align: center; }
.tb-error-inner { max-width: 480px; }
.tb-error-code {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1.25rem;
  border-radius: 99px;
  background: var(--tb-brand-soft);
  color: var(--tb-brand-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tb-error h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.tb-error p { color: var(--tb-muted); font-size: 1rem; margin-bottom: 2rem; }
.tb-error-art { position: relative; width: 132px; height: 96px; margin: 0 auto 1.75rem; }
.tb-error-art span {
  position: absolute;
  left: 50%;
  width: 120px;
  height: 26px;
  margin-left: -60px;
  border-radius: 8px;
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  box-shadow: var(--tb-shadow);
}
.tb-error-art span:nth-child(1) { top: 0; transform: rotate(-6deg); }
.tb-error-art span:nth-child(2) { top: 34px; transform: rotate(4deg) translateX(10px); }
.tb-error-art span:nth-child(3) { top: 68px; border-style: dashed; border-color: var(--tb-border-strong); background: transparent; box-shadow: none; }
.tb-error-art span::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 55%;
  height: 5px;
  border-radius: 99px;
  background: var(--tb-surface-3);
}
.tb-error-art span:nth-child(1)::before { background: var(--tb-brand); opacity: 0.6; }
.tb-error-art span:nth-child(3)::before { display: none; }
.tb-error-foot { text-align: center; padding: 1.25rem 1rem; font-size: 0.8125rem; color: var(--tb-subtle); }

/* Velzon's [data-bs-theme=dark] .btn-light grey text outranks theme.css; keep it legible here */
[data-bs-theme=dark] .tb-guest .btn-light:not(.tb-cta .btn-light) { --vz-btn-color: var(--tb-heading); --vz-btn-hover-color: var(--tb-heading); --vz-btn-active-color: var(--tb-heading); }
