
/* ==========================================================================
   Soft‑Mag – CSS global (brand albastru) cu suport Light/Dark + toggle
   Conform cerințelor: look&feel identic, fonturi, culori, background, layout
   ========================================================================== */

/* ---------------------------
   Variabile culori (Light)
   --------------------------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0d6efd;      /* albastru brand */
  --primary-dark: #0b5ed7; /* hover/active */
  --border: #e5e7eb;
  --focus-ring: rgba(13, 110, 253, .35);
}

/* ---------------------------------------------------------
   Variabile culori (Dark) – automat după preferința OS-ului
   --------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-alt: #0b1226;      /* foarte subtil mai deschis decât bg */
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #4ea8ff;     /* albastru potrivit pentru dark */
    --primary-dark: #3b8de6;
    --border: #1e293b;
    --focus-ring: rgba(78, 168, 255, .35);
  }
}

/* ---------------------------------------------------------
   Forțare explicită prin toggle (suprascrie preferința OS)
   --------------------------------------------------------- */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --border: #e5e7eb;
  --focus-ring: rgba(13, 110, 253, .35);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #0b1226;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #4ea8ff;
  --primary-dark: #3b8de6;
  --border: #1e293b;
  --focus-ring: rgba(78, 168, 255, .35);
}

/* ---------------------------
   Reset & bază tipografică
   --------------------------- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ---------------------------
   Header + bară sus
   --------------------------- */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 1rem;
}

.site-header-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
}

/* ---------------------------
   Navigație principală
   --------------------------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.main-nav a[aria-current="page"] {
  text-decoration: underline;
}

/* ---------------------------
   Buton toggle Light/Dark (dreapta sus)
   --------------------------- */
.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: .45rem;
  padding: .35rem .65rem;
  font: inherit;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.theme-toggle:hover {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .08);
}

.theme-bar {
  display: inline-flex;
  gap: .25rem;
  align-items: center;
}

.theme-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #fff;
  opacity: .85;
}

/* În Dark rămânem pe același stil (header e albastru luminos; text alb) */
[data-theme="dark"] .theme-toggle {
  color: #fff;
  border-color: rgba(255, 255, 255, .30);
}

/* ---------------------------
   Conținut principal
   --------------------------- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1, h2, h3 {
  line-height: 1.3;
}

p, small {
  color: var(--muted);
}

/* ---------------------------
   Formular
   --------------------------- */
form {
  margin-top: 1.5rem;
  max-width: 600px;
}

label {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
}

/* Câmpuri */
input,
textarea {
  width: 100%;
  padding: .6rem .7rem;
  margin-top: .3rem;
  border-radius: .35rem;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

/* Focus accesibil (ring subtil) */
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem var(--focus-ring);
}

/* Honeypot (ascuns) */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

/* Buton de acțiune */
button {
  margin-top: 1.2rem;
  padding: .6rem 1.2rem;
  border-radius: .45rem;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease;
}

button:hover {
  background: var(--primary-dark);
}

/* ---------------------------
   Contact & footer
   --------------------------- */
address {
  margin-top: 1rem;
  font-style: normal;
  color: var(--muted);
}

footer {
  margin-top: 3rem;
  padding: 1rem;
  background: var(--bg-alt);
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ---------------------------
   Mesaje (eroare)
   --------------------------- */
.error {
  background: #fee2e2;
  color: #991b1b;
  padding: .6rem .7rem;
  border-radius: .45rem;
  margin: 1rem 0;
}

/* Tonuri pentru Dark */
@media (prefers-color-scheme: dark) {
  .error {
    background: #2a0f14; /* roșu foarte închis */
    color: #fecaca;      /* roșu deschis */
  }
}

/* Alternativ, dacă forțăm tema dark via data-theme */
[data-theme="dark"] .error {
  background: #2a0f14;
  color: #fecaca;
}
