/* ===== 1. VARIABLE ȘI SETĂRI BAZĂ ===== */
:root {
  --text: #e8e8e3;
  --background: #1a1a1a;
  --primary: #a8b0b3;
  --secondary: #454b50;
  --accent: #FFD700;
  --secondary-accent: #FFD700;
  --section-dark-yellow: #a57c00;
  --gradient-yellow: linear-gradient(to right, #a57c00, #ffeb3b, #a57c00);
  --gradient-light-blue: linear-gradient(45deg, #00b7eb, #66d9ff);
  --welcome-dark-blue: #0088b3;
  --gradient-neon: linear-gradient(to right, #0088b3, #66d9ff, #0088b3);
  
  /* Variabile specifice Contact Form */
  --primary-blue: #0088b3;
  --muted: #9aa0a4;
  --form-bg: #000000;
  
  /* Dimensiuni standard pentru Desktop */
  --spacing-sm: 1.5rem;
  --spacing-md: 2.5rem;
  --spacing-lg: 4rem;
  --font-size-base: 1em;
  --font-size-sm: 0.9em;
  --font-size-md: 1.2em;
  --font-size-lg: 2.4em;

  /* Dimensiuni AJUSTATE pentru Mobil */
  --mobile-spacing-sm: 0.65rem;
  --mobile-spacing-md: 1.2rem;
  --mobile-spacing-lg: 2.0rem;
  --mobile-font-size-base: 0.9em;
  --mobile-font-size-sm: 0.8em;
  --mobile-font-size-md: 1.05em;
  --mobile-font-size-lg: 1.8em;

  /* Dimensiuni standard pentru Tabletă */
  --tablet-spacing-sm: 1rem;
  --tablet-spacing-md: 2rem;
  --tablet-spacing-lg: 3rem;
  --tablet-font-size-base: 1em;
  --tablet-font-size-sm: 0.9em;
  --tablet-font-size-md: 1.15em;
  --tablet-font-size-lg: 2.2em;
}

html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif !important;
}

button, a, .hamburger {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--background);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow-x: hidden;
  font-size: var(--font-size-base);
}

/* ===== 2. HEADER & NAVIGATION ===== */
header.top-bar {
  width: 100vw;
  height: 75px;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

header.top-bar .logo-text-image {
  height: 100px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  transition: transform 0.3s ease-in-out;
  margin-top: 5px;
}

header.top-bar .logo-text-image:hover {
  transform: scale(1.05);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 1em;
  font-weight: 600;
  padding: 0.5rem 1rem;
  position: relative;
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0.8;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--secondary-accent);
  transition: width 0.3s ease;
}

.nav-menu a:hover {
  color: var(--secondary-accent);
  opacity: 1;
}

.nav-menu a:hover::after {
  width: 100%;
}

/* HAMBURGER DEFAULT (Hidden on PC) */
.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.6em;
  color: var(--text);
  padding: 5px;
  transition: transform 0.3s ease, color 0.3s ease;
  z-index: 1001;
}

/* ===== MEDIA QUERY: PC & TABLET (≥ 768px) ===== */
@media (min-width: 768px) {
  header.top-bar { height: 85px; padding: 0 40px; }
  .nav-menu { position: absolute; left: 50%; transform: translateX(-50%); }
}

/* ===== MEDIA QUERY: MOBILE (< 768px) ===== */
@media (max-width: 767px) {
  header.top-bar {
    padding: 0 15px;
    height: 70px;
  }
  
  header.top-bar .logo-text-image {
    height: 60px;
    max-width: 90px;
    margin-left: -5px;
  }

  /* --- SERTAR MENIU MOBIL COMPACT --- */
  .nav-menu {
    display: none; 
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: #0f0f0f;
    border-bottom: 1px solid #222;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 999;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 10px 15px rgba(0,0,0,0.8);
  }

  .nav-menu.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
  }

  .nav-menu a {
    font-size: 0.95em;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding: 8px 0;
  }

  .nav-menu a:last-child {
    border-bottom: none;
  }

  .hamburger {
    display: block;
  }
  
  .hamburger.active {
    transform: rotate(90deg);
    color: var(--secondary-accent);
  }
}

/* ===== 3. LAYOUT PAGINĂ CONTACT ===== */
.contact-main { 
  max-width: 850px; 
  margin: 40px auto; 
  padding: 45px; 
  flex-grow: 1;
  width: 100%;
}

.contact-intro h1 { 
  font-size: 1.6rem; 
  margin-bottom: 15px; 
  font-weight: 700;
  line-height: 1.3;
}

.contact-intro p { 
  color: var(--muted); 
  margin-bottom: 45px; 
  line-height: 1.6;
}

/* STILUL CUTIEI FORMULARULUI */
.contact-form-section { 
  background: var(--form-bg); 
  padding: 40px; 
  border: 1px solid #1f1f1f; 
  border-radius: 12px; 
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.field-group { 
  display: flex; 
  flex-direction: column; 
  gap: 40px; 
}

/* ===== 4. INPUT & TEXTAREA ===== */
.input-wrap, .textarea-wrap { 
  position: relative; 
  width: 100%;
}

.textarea-wrap {
  border-radius: 8px;
  overflow: visible;
}

input, textarea { 
  width: 100%; 
  padding: 16px 14px; 
  border: 1px solid #2a2a2a; 
  border-radius: 8px; 
  background: transparent; 
  color: var(--text); 
  outline: none; 
  font-size: 1rem;
  position: relative;
  z-index: 5;
  transition: border-color 0.2s;
  min-height: 50px;
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
  
  /* 
     === SOLUȚIA PENTRU CONTOR STICKY ===
     padding-right: 70px;
     Asta creează un culoar gol de 70px pe toată înălțimea casetei, în partea dreaptă.
     Textul va face "wrap" automat înainte să ajungă la contor.
  */
  padding: 16px 70px 16px 14px; /* Top Right Bottom Left */
}

input:focus, textarea:focus { 
  border-color: var(--primary-blue); 
}

/* Labels */
.input-wrap label, 
.textarea-wrap .textarea-label { 
  position: absolute; 
  left: 14px; 
  top: 50%; 
  transform: translateY(-50%);
  color: var(--muted); 
  pointer-events: none; 
  transition: all 0.25s ease;
  z-index: 10;
  background: var(--form-bg); 
  padding: 0 4px;
}

.textarea-wrap .textarea-label {
  top: 24px;
  transform: translateY(-50%);
}

/* Active Label State */
.input-wrap.filled label, .input-wrap.focus label,
.textarea-wrap.filled .textarea-label, .textarea-wrap.focus .textarea-label { 
  top: 0 !important; 
  transform: translateY(-50%) scale(0.9) !important; 
  color: var(--primary-blue);
  font-weight: 600;
  left: 10px;
}

/* Required & Error Markers */
.input-wrap.required label::after,
.textarea-wrap.required .textarea-label::after {
  content: "*";
  color: #ff4d4f;
  margin-left: 4px;
}

.input-wrap.error input, 
.textarea-wrap.error textarea {
  border-color: #ff4d4f !important;
}

/* --- ERROR MESSAGES (DESKTOP) --- */
.field-error {
  color: #ff4d4f;
  font-size: 0.8rem;
  position: absolute; 
  bottom: -22px;
  left: 2px;
  white-space: nowrap;
}

/* Word Count */
.word-count { 
  position: absolute; 
  right: 14px; 
  bottom: 14px; 
  color: #666; 
  font-size: 0.85rem; 
  z-index: 15;
  font-weight: 700;
  /* Fundal opțional pentru a fi și mai clar că e separat, dacă vrei */
  /* background: var(--form-bg); */
}
.word-count.zero { color: #ff4d4f; }

/* ===== 5. BUTOANE ===== */
.form-actions { 
  display: flex; 
  gap: 12px; 
  justify-content: flex-end; 
  margin-top: 25px;
}

.btn { 
  padding: 12px 24px; 
  border-radius: 6px; 
  border: none; 
  cursor: pointer; 
  font-weight: 700; 
  transition: opacity 0.2s, transform 0.2s;
  font-size: 1rem;
}

.btn-blue { background: #007bb3; color: white; }
.btn-grey { background: #333; color: #ccc; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }

.form-message { margin-top: 15px; font-weight: 600; text-align: center; min-height: 24px; }

/* ===== 6. FOOTER ===== */
footer {
  background: #0a0a0a;
  color: var(--primary);
  padding: 30px 20px;
  margin-top: auto;
  border-top: 1px solid rgba(26, 26, 26, 0.3);
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-column h4 {
  font-family: "Albert Sans", sans-serif;
  font-size: 0.9em;
  color: var(--text);
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.social-icons {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border: 2px solid var(--secondary-accent);
  border-radius: 50%;
  color: var(--text);
  transition: transform 0.3s;
}

.social-icon:hover { transform: scale(1.1); color: var(--secondary-accent); }
.social-svg-icon { width: 25px; height: 25px; }

.footer-divider {
  border: none;
  height: 1px;
  background-color: rgba(255,255,255,0.1);
  width: 80%;
  margin: 30px auto;
}

/* === FOOTER BOTTOM === */
.footer-bottom {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--secondary);
}

.footer-bottom .rights {
  margin-top: 8px;
  font-size: 0.8em;
  color: var(--secondary);
}

.footer-bottom .rights a {
  color: var(--primary);
  text-decoration: none;
}

.footer-bottom .rights a:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVE FIXES (MOBIL) ===== */
@media (max-width: 768px) {
  .contact-main { 
    padding: 20px 15px; /* Margini laterale mai mici */
    margin-top: 10px;
  }
  
  .contact-intro h1 { font-size: 1.3rem; }
  .contact-intro p { font-size: 0.9rem; margin-bottom: 30px; }
  
  /* Formular Compact */
  .contact-form-section {
    padding: 20px 15px; /* Cutie mai strânsă */
  }
  
  /* INPUT-URI MAI MICI PE MOBIL */
  input, textarea {
    padding: 12px 10px; /* Padding redus */
    font-size: 0.9rem;  /* Text mai mic */
    min-height: 40px;   /* Înălțime redusă */
  }
  
  textarea {
    min-height: 120px; 
    /* 
       === CULOAR DE PROTECȚIE MOBIL ===
       padding-right: 60px;
       Contorul stă în dreapta jos, iar textul nu va ajunge niciodată la el.
    */
    padding: 12px 60px 12px 10px; 
  }

  .input-wrap label { font-size: 0.9rem; }
  .textarea-wrap .textarea-label { top: 20px; font-size: 0.9rem; }

  /* ERORI FLUIDE PE MOBIL (TOP 100%) */
  .field-error {
    font-size: 0.7rem; 
    bottom: auto; 
    top: 100%;    
    left: 2px;
    margin-top: 4px; 
    line-height: 1.1;  
    white-space: normal; 
    width: 100%;       
  }

  .field-error.email-long-error {
    font-size: 0.7rem;
  }

  /* GAP OPTIMIZAT */
  .field-group { 
    gap: 40px; 
  }
  
  /* Butoane Compacte */
  .form-actions { 
    flex-wrap: wrap; 
    gap: 20px;
    margin-top: 50px;
  }

  .btn {
    padding: 10px 18px; 
    font-size: 0.85rem;
    flex: 1; 
  }

  .word-count {
    bottom: 12px;
    right: 12px;
    font-size: 0.75rem;
  }

  /* === FOOTER BOTTOM MOBIL === */
  .footer-bottom {
    font-size: var(--mobile-font-size-sm);
  }

  .footer-bottom .rights {
    font-size: 0.7em;
  }
}