/* static/css/theme.css */

/* LIGHT tokens */
:root{
  --bg: #f8fafc;
  --bg2:#ffffff;
  --surface: rgba(255,255,255,.92);
  --surface-strong: #ffffff;
  --text:#0f172a;
  --muted:#475569;
  --muted2:#64748b;
  --border: rgba(15, 23, 42, .10);
  --border2: rgba(15, 23, 42, .07);

  --brand:#2563eb;
  --brand2:#4f46e5;

  --shadow-sm: 0 4px 24px rgba(0,0,0,.05);
  --shadow-md: 0 14px 40px rgba(0,0,0,.08);

  --radius-xl: 20px;
  --radius-2xl: 26px;

  --ring: 0 0 0 4px rgba(37,99,235,.18);
}

/* DARK tokens */
html[data-theme="dark"]{
  --bg:#0b0d13;
  --bg2:#0e1118;
  --surface: rgba(18, 21, 28, .78);
  --surface-strong: #12151c;
  --text:#e5e7eb;
  --muted:#a1a1aa;
  --muted2:#9ca3af;
  --border: rgba(15,23,42,.80);
  --border2: rgba(15,23,42,.60);

  --brand:#a855f7;
  --brand2:#4f46e5;

  --shadow-sm: 0 14px 50px rgba(0,0,0,.45);
  --shadow-md: 0 26px 90px rgba(0,0,0,.55);

  --ring: 0 0 0 4px rgba(168,85,247,.20);
}

html, body { 
  min-height: 100%; 
  width: 100%;
  overflow-x: hidden; 
}

body{
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 520px at 90% 10%, rgba(168,85,247,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
}

.k-container{ max-width: 72rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
@media (min-width: 640px){ .k-container{ padding-left: 1.5rem; padding-right: 1.5rem; } }

.k-surface{
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.k-border{ border-color: var(--border) !important; }
.k-muted{ color: var(--muted); }
.k-muted2{ color: var(--muted2); }

.k-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  border-radius:9999px; padding:.7rem 1.1rem; font-weight:700;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
  user-select:none;
}
.k-btn:active{ transform: translateY(1px); }
.k-btn-primary{
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color:#fff;
  box-shadow: 0 18px 60px rgba(37,99,235,.18);
}
html[data-theme="dark"] .k-btn-primary{ box-shadow: 0 18px 70px rgba(168,85,247,.20); }

.k-btn-secondary{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.k-btn-secondary:hover{ box-shadow: var(--shadow-sm); }

.k-focus:focus{ outline:none; box-shadow: var(--ring); }

/* NAV */
.k-nav{
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border2);
  background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
}
html[data-theme="dark"] .k-nav{
  background: rgba(11, 13, 19, .65);
  backdrop-filter: blur(10px);
}

/* Blobs */
.k-blob{
  position:absolute; pointer-events:none;
  filter: blur(90px);
  opacity: .22;
  transform: translateZ(0);
}
html[data-theme="dark"] .k-blob{ opacity: .36; filter: blur(115px); }

/* Carousel card dark polish */
html[data-theme="dark"] .k-carousel-card{
  background: rgba(21, 24, 34, .75) !important;
  border-color: rgba(255,255,255,.08) !important;
}

/* THEME SWITCH (sol/lua com animação) */
.theme-switch{
  position: relative;
  width: 128px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(148,163,184,.12);
  display: inline-flex;
  align-items: center;
  padding: 4px;
  transition: background .25s ease, border-color .25s ease;
}
html[data-theme="dark"] .theme-switch{
  background: rgba(255,255,255,.06);
}

.theme-switch .track{
  position:absolute;
  inset: 0;
  border-radius: 9999px;
  overflow:hidden;
}
.theme-switch .track::before{
  content:"";
  position:absolute;
  inset:-40%;
  background: radial-gradient(closest-side, rgba(37,99,235,.22), transparent 70%);
  transform: translateX(-18%);
  transition: transform .35s ease;
}
html[data-theme="dark"] .theme-switch .track::before{
  background: radial-gradient(closest-side, rgba(168,85,247,.30), transparent 70%);
  transform: translateX(18%);
}

.theme-switch .thumb{
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  transform: translateX(0);
  transition: transform .35s cubic-bezier(.2,.9,.2,1), background .25s ease;
  display:flex; align-items:center; justify-content:center;
  will-change: transform;
}
html[data-theme="dark"] .theme-switch .thumb{
  background: rgba(255,255,255,.92);
  transform: translateX(88px);
}

.theme-switch .icon{
  position:absolute;
  width: 18px; height: 18px;
  opacity: .9;
  transition: opacity .25s ease, transform .35s ease;
}
.theme-switch .icon.sun{
  left: 12px;
  color: rgba(37,99,235,.95);
}
.theme-switch .icon.moon{
  right: 12px;
  color: rgba(168,85,247,.95);
}
html[data-theme="dark"] .theme-switch .icon.sun{ opacity: .25; transform: scale(.92); }
html[data-theme="dark"] .theme-switch .icon.moon{ opacity: 1; transform: scale(1); }

html[data-theme="light"] .theme-switch .icon.sun{ opacity: 1; transform: scale(1); }
html[data-theme="light"] .theme-switch .icon.moon{ opacity: .25; transform: scale(.92); }

.theme-switch .label{
  position:absolute;
  left: 42px;
  right: 42px;
  text-align:center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events:none;
}

/* Inputs e Textareas */
.k-input {
  background-color: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}
.k-input:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.k-input::placeholder {
  color: var(--muted2);
}


/* Select dark fix */
html[data-theme="dark"] select {
  background-color: var(--surface-strong) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] select option {
  background-color: #12151c !important;
  color: #e5e7eb !important;
}

/* Tailwind border utilities – dark theme override
   Deixa todas as bordas/divisórias padrão bem mais escuras no tema dark */
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-t,
html[data-theme="dark"] .border-b,
html[data-theme="dark"] .border-l,
html[data-theme="dark"] .border-r,
html[data-theme="dark"] .divide-y > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-x > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border2) !important;
}