:root {
  --bg: #e8edf3;
  --bg-deep: #d9e1ec;
  --ink: #0f1a2a;
  --ink-soft: #3c4a5f;
  --muted: #6b7a90;
  --line: rgba(15, 26, 42, 0.1);
  --card: rgba(255, 255, 255, 0.72);
  --accent: #2457d6;
  --accent-soft: #dce6ff;
  --ok: #147a4b;
  --danger: #b42318;
  --shadow: 0 30px 80px rgba(20, 36, 64, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background: var(--bg);
}

.auth-body {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

.auth-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(160deg, #f4f7fb 0%, #e7eef7 45%, #dfe8f4 100%);
}

.auth-canvas .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.7;
  animation: drift 16s ease-in-out infinite alternate;
}

.blob-a {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  left: -8%;
  top: -10%;
  background: radial-gradient(circle, rgba(36, 87, 214, 0.22), transparent 70%);
}

.blob-b {
  width: 46vw;
  height: 46vw;
  max-width: 560px;
  max-height: 560px;
  right: -12%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(15, 26, 42, 0.12), transparent 68%);
  animation-delay: -6s;
}

.grid-fade {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 26, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 26, 42, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 75%);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, 24px, 0) scale(1.06); }
}

.auth-wrap {
  position: relative;
  z-index: 1;
}

.brand-panel,
.form-panel {
  border-radius: 28px;
  animation: enter 0.7s ease both;
}

.form-panel { animation-delay: 0.08s; }

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: clamp(28px, 4vw, 44px);
  background:
    linear-gradient(165deg, rgba(15, 26, 42, 0.96), rgba(18, 38, 72, 0.94));
  color: #f5f8fc;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  min-height: 100%;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: auto -20% -30% auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(88, 130, 255, 0.28), transparent 65%);
  pointer-events: none;
}

.brand-panel-top,
.brand-panel-copy,
.brand-metrics {
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: 72px;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
}

.brand-domain {
  margin: 14px 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 248, 252, 0.62);
  font-weight: 600;
}

.brand-eyebrow {
  margin: 0 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d7e2ff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 4.6rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: #fff;
}

.brand-lead {
  margin: 18px 0 0;
  max-width: 30ch;
  color: rgba(235, 241, 250, 0.78);
  font-size: 1.05rem;
  line-height: 1.65;
}

.brand-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.brand-metrics > div {
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-metrics strong {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.brand-metrics span {
  display: block;
  margin-top: 4px;
  color: rgba(235, 241, 250, 0.62);
  font-size: 0.78rem;
  line-height: 1.35;
}

.form-panel {
  display: flex;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  min-height: 100%;
}

.form-panel-inner {
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: clamp(24px, 4vw, 40px);
}

.form-head h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.9rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.form-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.auth-switch {
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.auth-switch .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 0.55rem 0;
  background: transparent;
}

.auth-switch .nav-link:hover {
  color: var(--ink);
  border-color: transparent;
}

.auth-switch .nav-link.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.form-label {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.86rem;
}

.form-control {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border-radius: 14px;
  min-height: 52px;
  box-shadow: none;
}

.form-control:focus {
  border-color: rgba(36, 87, 214, 0.45);
  box-shadow: 0 0 0 0.22rem rgba(36, 87, 214, 0.12);
  background: #fff;
  color: var(--ink);
}

.form-text {
  color: var(--muted);
}

.btn-ink {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--ink);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #18263c;
  --bs-btn-hover-border-color: #18263c;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0b1422;
  --bs-btn-active-border-color: #0b1422;
  border-radius: 14px;
  min-height: 52px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 12px 28px rgba(15, 26, 42, 0.18);
}

.btn-ink:hover {
  transform: translateY(-1px);
}

.auth-alert {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.auth-alert.is-error {
  color: #7a1c16;
  background: #fdeceb;
  border-color: #f3c4c0;
}

.auth-alert.is-ok {
  color: #0f5a38;
  background: #e8f7ef;
  border-color: #b9e4cd;
}

.form-foot {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.form-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard */
.dash-body {
  min-height: 100vh;
  background:
    radial-gradient(700px 380px at 10% -10%, rgba(36, 87, 214, 0.12), transparent 55%),
    linear-gradient(165deg, #f4f7fb, #e7eef7);
  color: var(--ink);
  font-family: "Sora", sans-serif;
}

.dash-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.dash-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.dash-nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dash-main {
  padding-top: 40px;
  padding-bottom: 60px;
}

.dash-main h1 {
  font-family: "Fraunces", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(2rem, 5vw, 3rem);
}

.dash-note {
  color: var(--muted);
  max-width: 48ch;
}

.dash-placeholder {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.dash-placeholder h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.dash-placeholder p {
  margin: 0;
  color: var(--muted);
}

.dash-intro {
  margin-bottom: 28px;
}

.tpl-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tpl-card-preview {
  position: relative;
  min-height: 170px;
  background: #111;
}

.tpl-card-preview-gaming-dark-gold {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.75)),
    radial-gradient(circle at 70% 30%, #c9a227, #1a1408 55%, #050505 80%);
}

.tpl-card-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.tpl-card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tpl-card-style {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tpl-card-body h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.tpl-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  flex: 1;
}

.tpl-card-meta {
  margin: 4px 0 10px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .brand-panel {
    min-height: auto;
    gap: 28px;
  }

  .brand-lead {
    max-width: none;
  }

  .brand-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .auth-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-panel,
  .form-panel {
    border-radius: 22px;
  }

  .brand-metrics {
    grid-template-columns: 1fr;
  }

  .brand-metrics > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }

  .brand-metrics span {
    margin-top: 0;
    text-align: right;
  }

  .form-control,
  .btn-ink {
    min-height: 48px;
  }

  .dash-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-canvas .blob,
  .brand-panel,
  .form-panel {
    animation: none !important;
  }
}
