/* ─── auth.css — pagini de autentificare (login / register / forgot) ─────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blue-darkest:  #061628;
  --blue-dark:     #0B2D5E;
  --blue-core:     #185FA5;
  --blue-bright:   #378ADD;
  --blue-light:    #85B7EB;
  --blue-pale:     #B5D4F4;
  --blue-ghost:    #E6F1FB;
  --green-dark:    #0F6E56;
  --green-mid:     #1D9E75;
  --green-pale:    #D5F5E3;
  --red:           #DC2626;
  --red-pale:      #FEE2E2;
  --surface:       #ffffff;
  --surface-2:     #f5f7fa;
  --surface-3:     #eef1f6;
  --text-primary:  #0B2D5E;
  --text-secondary:#4a5568;
  --text-muted:    #8898aa;
  --border:        rgba(11, 45, 94, 0.1);
  --border-strong: rgba(11, 45, 94, 0.18);
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --font: 'DM Sans', sans-serif;
}

.auth-body {
  font-family: var(--font);
  min-height: 100vh;
  color: var(--text-secondary);
  /* Fundal cu gradient subtil in paleta brandului */
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(55,138,221,0.12), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(29,158,117,0.10), transparent 55%),
    var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

/* ── CARD ───────────────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 48px rgba(11,45,94,0.10);
  padding: 36px 32px;
}
.auth-card-wide { max-width: 520px; }

/* Link discret "Inapoi la pagina principala", in varful cardului de auth. */
.auth-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  margin-bottom: 18px;
  transition: color var(--transition), gap var(--transition);
}
.auth-back i { font-size: 17px; }
.auth-back:hover { color: var(--blue-bright); gap: 9px; }

.auth-brand {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}

/* Logo compus (mar + text) — aceleasi dimensiuni si distante ca pe landing.
   Pe auth (fundal alb) NU punem glow. */
.brand-logo {
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none;
}
.brand-logo-mar  { height: 40px; width: auto; display: block; }
.brand-logo-text { height: 46px; width: auto; display: block; position: relative; top: 5px; margin-left: -20px; }
.brand-logo-full { height: 55px; width: auto; display: block; }

.auth-title {
  font-size: 22px; font-weight: 500; color: var(--text-primary);
  text-align: center; margin-bottom: 4px;
}
.auth-subtitle {
  font-size: 14px; color: var(--text-muted);
  text-align: center; margin-bottom: 24px;
}
.auth-subtitle-left { text-align: left; margin-bottom: 18px; }

/* ── ALERTE ─────────────────────────────────────────────────────────────────── */
.auth-alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.5; margin-bottom: 18px;
}
.auth-alert i { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.auth-alert.error   { background: var(--red-pale); color: #991B1B; }
.auth-alert.error i { color: var(--red); }
.auth-alert.success { background: var(--green-pale); color: #065F46; }
.auth-alert.success i { color: var(--green-mid); }
.auth-alert.info   { background: var(--blue-ghost); color: var(--blue-dark); }
.auth-alert.info i { color: var(--blue-bright); }

/* ── FORM ───────────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-label {
  font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px;
}
.form-label span { color: var(--text-muted); font-weight: 400; }

.form-input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 14px; color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(55,138,221,0.12);
}
.form-input::placeholder { color: var(--text-muted); }

/* Input cu iconita la stanga (+ buton la dreapta pentru parola) */
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > i {
  position: absolute; left: 13px; font-size: 18px; color: var(--text-muted);
  pointer-events: none;
}
.input-icon .form-input { padding-left: 40px; }
.input-toggle {
  position: absolute; right: 8px;
  background: transparent; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 18px;
  transition: background var(--transition);
}
.input-toggle:hover { background: var(--surface-2); }

.code-input {
  text-align: center; letter-spacing: 12px;
  font-size: 24px; font-weight: 600; padding-left: 14px;
}

/* ── TOGGLE PF / PJ (segmented) ─────────────────────────────────────────────── */
.seg-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px;
}
.seg-option {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 10px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.seg-option i { font-size: 17px; }
.seg-option input { position: absolute; opacity: 0; pointer-events: none; }
.seg-option.active { background: var(--blue-bright); color: #fff; }

/* ── CHECKBOX ───────────────────────────────────────────────────────────────── */
.auth-checkbox {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.auth-checkbox input { width: 16px; height: 16px; accent-color: var(--blue-bright); cursor: pointer; }

/* ── BUTOANE ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; font-family: var(--font);
  border: none; cursor: pointer; text-decoration: none;
  transition: filter var(--transition), transform var(--transition);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: scale(0.99); filter: none; }
.btn i { font-size: 18px; }
.btn-primary { background: var(--blue-bright); color: #fff; }
.btn-block { width: 100%; }
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: var(--surface-2); filter: none; transform: none; }

/* ── HOME (landing placeholder) ─────────────────────────────────────────────── */
.home-card { text-align: center; }
.home-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-ghost); color: var(--blue-core);
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 100px; margin-bottom: 16px;
}
.home-badge i { font-size: 15px; }
.home-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

/* ── LINK-URI + ROW ─────────────────────────────────────────────────────────── */
.auth-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-link {
  color: var(--blue-bright); text-decoration: none; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.auth-link:hover { text-decoration: underline; }
/* Varianta mai mare si bold (ex. "Directioneaza fara cont" pe login). */
.auth-link-strong { font-size: 16px; font-weight: 700; }
.auth-footer {
  text-align: center; font-size: 14px; color: var(--text-muted);
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border);
}

/* ── INDICATOR PASI (forgot password) ───────────────────────────────────────── */
.auth-steps { display: flex; align-items: center; margin-bottom: 24px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; position: relative; }
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px;
  background: var(--border); z-index: 0;
}
.step.done::after, .step.active::after { background: var(--blue-bright); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; z-index: 1;
  border: 2px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: all var(--transition);
}
.step.done .step-dot { background: var(--blue-bright); border-color: var(--blue-bright); color: #fff; }
.step.active .step-dot { border-color: var(--blue-bright); color: var(--blue-bright); }
.step-label { font-size: 11px; color: var(--text-muted); }
.step.active .step-label { color: var(--blue-core); font-weight: 500; }

.pj-fields, .pf-fields { display: flex; flex-direction: column; gap: 16px; }

/* Mesaj de eroare per camp (validare jQuery / server). Gol cat timp campul e valid. */
.field-error {
  display: block;
  font-size: 12.5px;
  color: var(--red);
  margin-top: 5px;
}
.field-error:empty { display: none; }
/* Evidentiem campul invalid (clasa pusa de jQuery validate). */
.form-input.input-validation-error {
  border-color: var(--red);
}

/* Hint sub camp (ex. feedback ANAF la CUI). */
.field-hint {
  display: block;
  font-size: 12.5px;
  color: var(--green-mid);
  margin-top: 5px;
}
.field-hint.error { color: var(--red); }

/* Box de info firma (date ANAF dupa CUI): stari succes / eroare. */
.info-firma {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}
.info-firma[hidden] { display: none; }
.info-firma.succes {
  background: var(--green-pale, #d5f5e3);
  border: 1px solid var(--green-mid, #1d9e75);
  color: var(--green-dark, #0f6e56);
}
.info-firma.eroare {
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid var(--red, #dc3545);
  color: var(--red, #dc3545);
}
.info-firma-header {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; margin-bottom: 8px;
}
.info-firma-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.info-firma-item { display: flex; flex-direction: column; }
.info-firma-item-wide { grid-column: 1 / -1; }
.info-firma-lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  opacity: 0.75;
}
.info-firma-val { font-weight: 500; }

/* Spinner in interiorul campului CUI cat se interogheaza ANAF. */
.input-spinner {
  position: absolute; right: 12px;
  color: var(--blue-bright); font-size: 18px;
  display: flex; align-items: center;
}
/* Atributul hidden trebuie sa invinga display:flex, altfel spinner-ul ramane vizibil mereu. */
.input-spinner[hidden] { display: none; }
.input-spinner i { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
/* Badge "Tip cont detectat" — afisat dupa verificarea CUI (rol dedus din CAEN). */
.tip-cont-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--blue-ghost);
  border: 1px solid var(--blue-light);
  color: var(--blue-core);
  font-weight: 500; font-size: 14px;
}
.tip-cont-badge i { font-size: 18px; }

/* Containerul reCAPTCHA — spatiere fata de buton. Widget-ul Google e ~302px latime;
   pe ecrane foarte inguste il scalam usor ca sa nu iasa din card. */
.auth-captcha { margin: 6px 0 18px; display: flex; justify-content: center; }

/* Text GDPR sub formular (creare cont / generare documente). Discret, lizibil. */
.auth-gdpr {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.auth-gdpr a { color: var(--blue-bright); text-decoration: underline; }
.auth-gdpr a:hover { color: var(--blue-core); }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: var(--radius-lg); }
  .form-row { grid-template-columns: 1fr; }
  .auth-shell { padding: 16px; }

  /* reCAPTCHA scalat ca sa incapa pe telefoane inguste (origin stanga-sus). */
  .auth-captcha .g-recaptcha {
    transform: scale(0.88);
    transform-origin: center;
  }
}
