/* ITIC visual theme — presentation only; business logic stays untouched. */

:root {
  --itic-blue: #3b00db;
  --itic-blue-dark: #2d00a8;
  --itic-blue-soft: #ebe6ff;
  --itic-black: #050505;
  --itic-white: #ffffff;
  --itic-gray: #f2f2f4;
  --itic-line: rgba(5, 5, 5, 0.14);
  --itic-shadow: 0 24px 60px rgba(5, 5, 5, 0.12);
  --itic-shadow-soft: 0 12px 30px rgba(5, 5, 5, 0.08);

  --background: 240 8% 95%;
  --foreground: 0 0% 2%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 2%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 2%;
  --primary: 256 100% 43%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 266 83% 58%;
  --secondary: 254 100% 96%;
  --secondary-foreground: 256 100% 31%;
  --muted: 240 8% 92%;
  --muted-foreground: 240 4% 39%;
  --accent: 254 100% 95%;
  --accent-foreground: 256 100% 31%;
  --border: 240 5% 84%;
  --input: 240 5% 78%;
  --ring: 256 100% 43%;
  --gradient-primary: linear-gradient(135deg, #3b00db, #6d35f3);
  --gradient-subtle: linear-gradient(180deg, #ffffff, #f2f2f4);
  --shadow-elegant: 0 18px 44px -14px rgba(59, 0, 219, 0.34);
  --shadow-soft: 0 8px 28px -10px rgba(5, 5, 5, 0.16);
  --radius: 0.5rem;
  --sidebar-background: 0 0% 100%;
  --sidebar-foreground: 0 0% 12%;
  --sidebar-primary: 256 100% 43%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 254 100% 95%;
  --sidebar-accent-foreground: 256 100% 31%;
  --sidebar-border: 240 5% 84%;
  --sidebar-ring: 256 100% 43%;
}

.dark {
  --background: 0 0% 4%;
  --foreground: 0 0% 97%;
  --card: 0 0% 7%;
  --card-foreground: 0 0% 97%;
  --popover: 0 0% 7%;
  --popover-foreground: 0 0% 97%;
  --primary: 258 100% 64%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 265 100% 72%;
  --secondary: 256 28% 16%;
  --secondary-foreground: 254 100% 91%;
  --muted: 0 0% 13%;
  --muted-foreground: 0 0% 68%;
  --accent: 256 35% 18%;
  --accent-foreground: 254 100% 91%;
  --border: 0 0% 22%;
  --input: 0 0% 25%;
  --ring: 258 100% 64%;
  --sidebar-background: 0 0% 5%;
  --sidebar-foreground: 0 0% 97%;
  --sidebar-primary: 258 100% 64%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 256 35% 18%;
  --sidebar-accent-foreground: 254 100% 91%;
  --sidebar-border: 0 0% 22%;
  --sidebar-ring: 258 100% 64%;
}

html {
  min-height: 100%;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  font-family: "degular", Inter, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

body {
  min-height: 100vh;
  background-color: hsl(var(--background));
  background-image:
    linear-gradient(90deg, rgba(59, 0, 219, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(59, 0, 219, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
}

::selection {
  color: var(--itic-white);
  background: var(--itic-blue);
}

:focus-visible {
  outline-color: var(--itic-blue);
}

.min-h-screen.bg-background,
.min-h-screen[class*="bg-gradient"] {
  background-color: hsl(var(--background));
  background-image:
    linear-gradient(90deg, rgba(59, 0, 219, 0.065) 1px, transparent 1px),
    linear-gradient(0deg, rgba(59, 0, 219, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 88% 6%, rgba(59, 0, 219, 0.12), transparent 28%);
  background-size: 72px 72px, 72px 72px, auto;
}

.container {
  width: min(100% - 32px, 1400px);
  padding-inline: 0;
}

h1,
h2,
h3,
h4 {
  color: hsl(var(--foreground));
  font-family: "degular-display", "degular", Inter, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.018em;
}

h1,
h2,
.font-bold,
.font-semibold {
  text-wrap: balance;
}

a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

header,
[class*="sticky"][class*="top-0"][class*="border-b"] {
  border-color: var(--itic-line);
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 28px rgba(5, 5, 5, 0.06);
  backdrop-filter: blur(18px);
}

.dark header,
.dark [class*="sticky"][class*="top-0"][class*="border-b"] {
  background-color: rgba(5, 5, 5, 0.92);
}

header {
  position: relative;
}

header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--itic-blue) 0 34%, transparent 34%);
  pointer-events: none;
}

nav a,
nav button {
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

nav a:hover,
nav button:hover {
  color: hsl(var(--foreground));
}

/* Authentication screens */
.min-h-screen.flex.items-center.justify-center {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: 36px;
}

.min-h-screen.flex.items-center.justify-center::before {
  position: absolute;
  z-index: -1;
  top: -18%;
  right: -6%;
  width: min(36vw, 520px);
  height: 72%;
  content: "";
  background: var(--itic-blue);
  opacity: 0.94;
  transform: rotate(17deg);
  transform-origin: center;
}

.min-h-screen.flex.items-center.justify-center::after {
  position: absolute;
  z-index: -1;
  right: 5vw;
  bottom: 4vh;
  width: 116px;
  height: 116px;
  border: 20px solid var(--itic-black);
  border-radius: 50%;
  content: "";
  opacity: 0.08;
}

.min-h-screen.flex.items-center.justify-center > .w-full {
  width: min(100%, 480px);
}

.min-h-screen.flex.items-center.justify-center .text-center.space-y-4 {
  position: relative;
  overflow: hidden;
  padding: 24px 28px;
  border: 1px solid var(--itic-line);
  border-radius: 8px 8px 8px 36px;
  background: var(--itic-white);
  box-shadow: var(--itic-shadow-soft);
}

.min-h-screen.flex.items-center.justify-center .text-center.space-y-4::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  content: "";
  background: var(--itic-blue);
}

.dark .min-h-screen.flex.items-center.justify-center .text-center.space-y-4 {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--itic-white);
}

.min-h-screen.flex.items-center.justify-center img[alt="Logo ITIC"] {
  width: min(100%, 350px);
  height: auto;
  max-height: 92px;
  filter: none;
}

.min-h-screen.flex.items-center.justify-center h1 {
  color: var(--itic-black);
  background: none;
  font-size: clamp(1.9rem, 6vw, 2.55rem);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.min-h-screen.flex.items-center.justify-center .text-center p {
  color: rgba(5, 5, 5, 0.62);
}

.min-h-screen.flex.items-center.justify-center [class*="text-card-foreground"] {
  position: relative;
  overflow: hidden;
  border-color: var(--itic-line);
  border-radius: 8px 36px 8px 8px;
  background: hsl(var(--card) / 0.97);
  box-shadow: var(--itic-shadow);
}

.min-h-screen.flex.items-center.justify-center [class*="text-card-foreground"]::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 38%;
  height: 6px;
  content: "";
  background: var(--itic-blue);
}

/* Cards and panels */
[class*="text-card-foreground"][class*="border"],
[role="dialog"],
[data-radix-popper-content-wrapper] > div {
  border-color: var(--itic-line);
  box-shadow: var(--itic-shadow-soft);
}

[class*="text-card-foreground"][class*="border"] {
  border-radius: 8px 24px 8px 8px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

[class*="text-card-foreground"][class*="border"]:hover {
  border-color: rgba(59, 0, 219, 0.26);
}

[role="dialog"] {
  border-radius: 8px 32px 8px 8px;
}

/* Buttons */
button,
[role="button"] {
  letter-spacing: -0.005em;
}

button.bg-primary,
a.bg-primary,
[role="button"].bg-primary {
  border: 1px solid var(--itic-blue);
  border-radius: 7px;
  background: var(--itic-blue);
  box-shadow: 0 10px 24px rgba(59, 0, 219, 0.2);
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button.bg-primary:hover,
a.bg-primary:hover,
[role="button"].bg-primary:hover {
  background: var(--itic-blue-dark);
  box-shadow: 0 14px 30px rgba(59, 0, 219, 0.28);
  transform: translateY(-2px);
}

button.bg-primary:active,
a.bg-primary:active,
[role="button"].bg-primary:active {
  transform: translateY(0);
}

button[class*="border-input"],
button[class*="border-border"],
a button:not(.bg-primary) {
  border-radius: 7px;
  background-color: hsl(var(--card));
}

button[class*="border-input"]:hover,
button[class*="border-border"]:hover,
a button:not(.bg-primary):hover {
  border-color: rgba(59, 0, 219, 0.36);
  background-color: hsl(var(--accent));
}

button:disabled,
[role="button"][aria-disabled="true"] {
  transform: none !important;
  box-shadow: none !important;
}

/* Form controls */
input,
select,
textarea,
[role="combobox"] {
  border-radius: 7px !important;
}

input[class*="border-input"],
select[class*="border-input"],
textarea[class*="border-input"],
[role="combobox"][class*="border-input"] {
  border-color: hsl(var(--input));
  background-color: hsl(var(--card));
  box-shadow: 0 2px 0 rgba(5, 5, 5, 0.025);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input[class*="border-input"]:hover,
select[class*="border-input"]:hover,
textarea[class*="border-input"]:hover,
[role="combobox"][class*="border-input"]:hover {
  border-color: rgba(59, 0, 219, 0.42);
}

input[class*="border-input"]:focus,
select[class*="border-input"]:focus,
textarea[class*="border-input"]:focus,
[role="combobox"][class*="border-input"]:focus {
  border-color: var(--itic-blue);
  box-shadow: 0 0 0 3px rgba(59, 0, 219, 0.13);
}

label {
  color: hsl(var(--foreground));
  font-weight: 650;
}

/* Tabs, badges and progress indicators */
[role="tablist"] {
  border: 1px solid var(--itic-line);
  border-radius: 8px;
  background: hsl(var(--muted));
}

[role="tab"][data-state="active"] {
  color: var(--itic-white);
  background: var(--itic-blue);
  box-shadow: 0 8px 18px rgba(59, 0, 219, 0.18);
}

.rounded-full.bg-primary\/10,
[class*="rounded-full"][class*="bg-primary/10"] {
  border: 1px solid rgba(59, 0, 219, 0.16);
  background: var(--itic-blue-soft);
}

[data-state="checked"],
[aria-selected="true"] {
  accent-color: var(--itic-blue);
}

/* Tables and lists */
table {
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--itic-line);
  border-radius: 8px;
  background: hsl(var(--card));
  box-shadow: var(--itic-shadow-soft);
}

thead {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

th {
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

tbody tr {
  transition: background-color 150ms ease;
}

tbody tr:hover {
  background: hsl(var(--accent) / 0.64);
}

/* Public documentation and legal pages */
.max-w-5xl > .text-center.mb-10 {
  position: relative;
  overflow: hidden;
  padding: 42px 32px;
  border-radius: 8px 48px 8px 8px;
  color: var(--itic-white);
  background: var(--itic-black);
  box-shadow: var(--itic-shadow);
}

.max-w-5xl > .text-center.mb-10::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, transparent 0 48%, var(--itic-blue) 48% 59%, transparent 59%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 100% 100%, 24px 100%;
  opacity: 0.95;
}

.max-w-5xl > .text-center.mb-10 > * {
  position: relative;
  z-index: 1;
}

.max-w-5xl > .text-center.mb-10 h1 {
  color: var(--itic-white);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 850;
  line-height: 0.92;
}

.max-w-5xl > .text-center.mb-10 p {
  color: rgba(255, 255, 255, 0.76);
}

.max-w-5xl > .text-center.mb-10 [class*="bg-primary/10"] {
  color: var(--itic-white);
  background: var(--itic-blue);
}

.max-w-5xl aside nav {
  padding: 20px;
  border: 1px solid var(--itic-line);
  border-radius: 8px 8px 8px 28px;
  background: hsl(var(--card) / 0.96);
  box-shadow: var(--itic-shadow-soft);
}

.max-w-5xl aside nav a {
  border-radius: 6px;
}

.max-w-5xl aside nav a:hover {
  color: var(--itic-blue);
  background: var(--itic-blue-soft);
}

.max-w-5xl main h2,
.max-w-5xl .lg\:grid-cols-\[240px_1fr\] h2 {
  padding-left: 16px;
  border-left: 6px solid var(--itic-blue);
  font-weight: 820;
}

.max-w-5xl main h3,
.max-w-5xl .lg\:grid-cols-\[240px_1fr\] h3 {
  font-weight: 760;
}

.max-w-5xl section,
.max-w-5xl article {
  scroll-margin-top: 32px;
}

/* Footer */
footer {
  position: relative;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: rgba(255, 255, 255, 0.74);
  background: var(--itic-black);
}

footer::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--itic-blue) 0 32%, rgba(255, 255, 255, 0.18) 32% 100%);
}

footer a {
  color: rgba(255, 255, 255, 0.78);
}

footer a:hover {
  color: var(--itic-white);
}

/* Scrollbars */
* {
  scrollbar-color: var(--itic-blue) hsl(var(--muted));
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: hsl(var(--muted));
}

*::-webkit-scrollbar-thumb {
  border: 2px solid hsl(var(--muted));
  border-radius: 10px;
  background: var(--itic-blue);
}

@media (max-width: 767px) {
  .container {
    width: min(100% - 24px, 640px);
  }

  .min-h-screen.flex.items-center.justify-center {
    padding: 18px 12px;
  }

  .min-h-screen.flex.items-center.justify-center::before {
    top: -8%;
    right: -28%;
    width: 70vw;
    height: 42%;
  }

  .min-h-screen.flex.items-center.justify-center .text-center.space-y-4 {
    padding: 20px 22px;
    border-radius: 8px 8px 8px 28px;
  }

  .min-h-screen.flex.items-center.justify-center [class*="text-card-foreground"] {
    border-radius: 8px 28px 8px 8px;
  }

  .max-w-5xl > .text-center.mb-10 {
    padding: 34px 22px;
    border-radius: 8px 32px 8px 8px;
    text-align: left;
  }

  table {
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
