/* LOCATION: public/css/base.css */
/* ============================================================
   BASE — RESET, VARIABILE, TIPOGRAFIE, BACKGROUND
   Apple Liquid Glass + Startup Tech Edition
   ============================================================ */

/* ============================================================
   1. RESET GLOBAL
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100vw;
  overflow-x: hidden;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6, p, a, span, li {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1, h2, h3, h4 {
  text-wrap: balance;          /* titluri centrate, rupte frumos */
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================
   2. VARIABILE GLOBALE
   ============================================================ */
:root {
  /* Gradiente premium (albastru, cyan, teal) */
  --gradient-primary: linear-gradient(135deg, #007aff 0%, #0a84ff 50%, #5ac8fa 100%);
  --gradient-accent:  linear-gradient(135deg, #00c7be 0%, #30d5c8 50%, #5ac8fa 100%);
  --gradient-text:    linear-gradient(135deg, #007aff 0%, #00c7be 60%, #5ac8fa 100%);

  /* Glass — strat de bază */
  --glass-bg:          rgba(255, 255, 255, 0.55);
  --glass-bg-hover:    rgba(255, 255, 255, 0.72);
  --glass-strong:      rgba(255, 255, 255, 0.82);
  --glass-border:      rgba(255, 255, 255, 0.65);

  /* Glass — reflexii lichide (specular) */
  --glass-sheen:       linear-gradient(
                         135deg,
                         rgba(255, 255, 255, 0.35) 0%,
                         rgba(255, 255, 255, 0.10) 45%,
                         rgba(255, 255, 255, 0.04) 100%
                       );
  --glass-highlight:   inset 0 1px 0 rgba(255, 255, 255, 0.90),
                       inset 0 -1px 0 rgba(255, 255, 255, 0.15),
                       inset 0 0 0 0.5px rgba(255, 255, 255, 0.06);

  /* Umbre (separate, ca să respecte tema) */
  --shadow-1:          0 10px 36px rgba(0, 0, 0, 0.08);
  --shadow-2:          0 2px 6px   rgba(0, 0, 0, 0.04);
  --shadow-1-hover:    0 14px 44px rgba(0, 0, 0, 0.12);
  --shadow-2-hover:    0 3px 8px   rgba(0, 0, 0, 0.06);

  /* Text */
  --text:              #1d1d1f;
  --text-secondary:    #3a3a3c;
  --text-muted:        #86868b;

  /* Accent */
  --accent:            #007aff;
  --accent-hover:      #0066d6;
  --accent-cyan:       #00c7be;
  --danger:            #ff3b30;
  --success:           #34c759;
  --warning:           #ff9500;

  /* Blur */
  --backdrop-blur:     30px;
  --backdrop-saturate: 180%;

  /* Radius */
  --radius-sm:  10px;
  --radius-md:  14px;
  --radius-lg:  18px;
  --radius-xl:  22px;
  --radius-pill: 999px;

  /* Tranziții — easing Apple spring */
  --transition:      280ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --spring:          cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Font */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --glass-bg:       rgba(28, 28, 30, 0.55);
  --glass-bg-hover: rgba(40, 40, 44, 0.72);
  --glass-strong:   rgba(28, 28, 30, 0.82);
  --glass-border:   rgba(255, 255, 255, 0.12);

  --glass-sheen:    linear-gradient(
                      135deg,
                      rgba(255, 255, 255, 0.10) 0%,
                      rgba(255, 255, 255, 0.03) 45%,
                      rgba(255, 255, 255, 0.05) 100%
                    );
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14),
                     inset 0 -1px 0 rgba(255, 255, 255, 0.03),
                     inset 0 0 0 0.5px rgba(255, 255, 255, 0.06);

  --shadow-1:       0 10px 36px rgba(0, 0, 0, 0.45);
  --shadow-2:       0 2px 6px   rgba(0, 0, 0, 0.30);
  --shadow-1-hover: 0 14px 44px rgba(0, 0, 0, 0.55);
  --shadow-2-hover: 0 3px 8px   rgba(0, 0, 0, 0.40);

  --text:           #f5f5f7;
  --text-secondary: #d1d1d6;
  --text-muted:     #8e8e93;
}

/* ============================================================
   3. BODY + BACKGROUND AURORA (cross-browser fix)
   ============================================================ */
body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background-color: #f5f5f7;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
}

/* Aurora — pe pseudo-element fixed, ca să nu se rupă pe iOS */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at top left,     rgba(0, 122, 255, 0.14), transparent 55%),
    radial-gradient(ellipse at top right,    rgba(0, 199, 190, 0.11), transparent 55%),
    radial-gradient(ellipse at bottom center,rgba(90, 200, 250, 0.09), transparent 60%);
  transition: opacity 400ms ease;
}

[data-theme="dark"] body {
  background-color: #000;
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse at top left,     rgba(0, 122, 255, 0.24), transparent 55%),
    radial-gradient(ellipse at top right,    rgba(0, 199, 190, 0.20), transparent 55%),
    radial-gradient(ellipse at bottom center,rgba(90, 200, 250, 0.13), transparent 60%);
}

/* ============================================================
   4. CONTAINER
   ============================================================ */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

main {
  padding-top: clamp(16px, 3vw, 24px);
}

/* ============================================================
   5. TIPOGRAFIE (Apple Startup Tech)
   ============================================================ */
.heading-md {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.035em;     /* mai tight ca Apple */
  line-height: 1.12;
  color: var(--text);
  margin: 0 0 4px;
}

.heading-xs {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
}

.text-center { text-align: center; }

.text-secondary {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

/* Eyebrow — micro-label deasupra titlurilor (vibe startup) */
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* Pill / badge — pentru stats, tag-uri, "New" labels */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  background: var(--glass-sheen), var(--glass-bg);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
}

/* ============================================================
   6. GLASS UTILITY — Liquid Glass real
   ============================================================ */
.glass {
  position: relative;
  background: var(--glass-sheen), var(--glass-bg);
  backdrop-filter: blur(var(--backdrop-blur)) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(var(--backdrop-blur)) saturate(var(--backdrop-saturate));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-1), var(--shadow-2), var(--glass-highlight);
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.glass:hover {
  background: var(--glass-sheen), var(--glass-bg-hover);
  box-shadow: var(--shadow-1-hover), var(--shadow-2-hover), var(--glass-highlight);
}

/* Fallback: browsere fără backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-strong);
  }
}

/* ============================================================
   7. SAFE AREA (iPhone notch / Dynamic Island)
   ============================================================ */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
}

/* ============================================================
   8. SCROLLBAR (Liquid Glass style)
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 128, 0.3);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 128, 0.5);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.30);
}

/* Selection — temă-aware */
::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--text);
}

/* ============================================================
   9. ACCESSIBILITY
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
  transition: outline-offset 120ms ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Reduced transparency — scoate blur, pune fundal solid */
@media (prefers-reduced-transparency: reduce) {
  .glass,
  .pill {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--glass-strong);
  }
}

/* High contrast */
@media (prefers-contrast: more) {
  :root {
    --text-muted: #4a4a4d;
    --glass-border: rgba(0, 0, 0, 0.35);
  }
  [data-theme="dark"] {
    --text-muted: #c7c7cc;
    --glass-border: rgba(255, 255, 255, 0.35);
  }
  .glass {
    border-width: 1.5px;
  }
}

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .container {
    padding: 0 16px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 14px;
  }

  .heading-md { font-size: 22px; }
  .heading-xs { font-size: 17px; }

  /* Pe mobil scădem blur-ul — păstrăm FPS-ul */
  :root {
    --backdrop-blur: 20px;
    --backdrop-saturate: 160%;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }
}

/* Touch devices — hover-ul e inutil, îl dezactivăm */
@media (hover: none) {
  .glass:hover {
    background: var(--glass-sheen), var(--glass-bg);
    box-shadow: var(--shadow-1), var(--shadow-2), var(--glass-highlight);
  }
}

/* ============================================
   LOGO THEME SWITCHING (light/dark)
   ============================================ */
.logo-icon-light { display: inline-block !important; }
.logo-icon-dark  { display: none !important; }

[data-theme="dark"] .logo-icon-light { display: none !important; }
[data-theme="dark"] .logo-icon-dark  { display: inline-block !important; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .logo-icon-light { display: none !important; }
  html:not([data-theme="light"]) .logo-icon-dark  { display: inline-block !important; }
}

.auth-logo-img.logo-icon-light { display: inline-block !important; }
.auth-logo-img.logo-icon-dark  { display: none !important; }
[data-theme="dark"] .auth-logo-img.logo-icon-light { display: none !important; }
[data-theme="dark"] .auth-logo-img.logo-icon-dark  { display: inline-block !important; }