/* Variabile */
:root {
  --navy: #1e3a8a;
  --navy-deep: #172c69;
  --navy-tint: #e8edf8;
  --ink: #14213d;
  --muted: #566079;
  --line: #dbe1ec;
  --paper: #f3f5f9;
  --surface: #ffffff;
  --focus: #2563eb;

  --ok-text: #146c43;
  --ok-bg: #ecf7f0;
  --ok-line: #b5dfc5;
  --err-text: #9b1c1c;
  --err-bg: #fdf0f0;
  --err-line: #f1c0c0;

  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 2rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
}

main {
  min-width: 0;
  flex: 1;
}

h1,
h2,
p,
dd {
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Butoane */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.975rem;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-deep);
}

.btn-primary:disabled {
  background: var(--muted);
  cursor: progress;
}

.btn-outline {
  white-space: nowrap;
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
  padding: 0.5rem 1rem;
  font-size: 0.925rem;
}

.btn-outline:hover {
  border-color: var(--navy);
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
}

.header-branding {
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  max-width: 100%;
  height: 40px;
  width: auto;
}

.header-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--navy);
}

/* Hero */
.hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.hero-container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.hero-title {
  font-size: clamp(2.5rem, 6.2vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--navy);
  max-width: 11ch;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 34rem;
}

.help-options {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.04), 0 12px 32px -12px rgba(20, 33, 61, 0.14);
  overflow: hidden;
}

.help-options li + li {
  border-top: 1px solid var(--line);
}

.help-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.help-option:hover {
  background: var(--navy-tint);
}

.help-option:focus-visible {
  outline-offset: -2px;
}

.help-option-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.help-option-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.075rem;
  color: var(--ink);
}

.help-option-hint {
  font-size: 0.9rem;
  color: var(--muted);
}

.help-option-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--navy);
  transition: transform 0.15s ease;
}

.help-option:hover .help-option-icon {
  transform: translateX(3px);
}

/* Disponibilitate chat (html[data-chat] este setat de widgetul de chat DMI Ticketing) */
.chat-presence {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a3abbd;
}

.chat-launch .chat-hint-online,
html[data-chat="online"] .chat-launch .chat-hint-offline {
  display: none;
}

html[data-chat="online"] .chat-launch .chat-hint-online {
  display: block;
}

html[data-chat="online"] .chat-presence {
  background: #22a35a;
  box-shadow: 0 0 0 3px rgba(34, 163, 90, 0.18);
}

/* Secțiuni */
.contact-section,
.faq-section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.faq-section {
  border-top: 1px solid var(--line);
}

.contact-container,
.faq-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.contact-intro {
  position: sticky;
  top: 104px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}

.section-subtitle {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 30rem;
}

.workstation-note {
  overflow-wrap: anywhere;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--navy);
  background: var(--navy-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.925rem;
  color: var(--ink);
}

.workstation-note[hidden] {
  display: none;
}

/* Formular */
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.ticket-form,
.ticket-status-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.35rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.form-group label,
.label-text {
  font-weight: 500;
  font-size: 0.925rem;
  color: var(--ink);
}

.optional {
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.25rem;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.field-error {
  font-size: 0.85rem;
  color: var(--err-text);
}

.form-group [aria-invalid="true"] {
  border-color: var(--err-line);
}

/* Honeypot: off screen for people, still in the form for bots. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #c9d1df;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9aa3b5;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: #a9b3c6;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group .file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1.5px dashed #c9d1df;
  border-radius: var(--radius-sm);
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.file-drop svg {
  width: 18px;
  height: 18px;
}

.form-group .file-drop:hover,
.form-group .file-drop.is-dragover {
  border-color: var(--navy);
  background: var(--navy-tint);
}

.ticket-form:has(#form-attachments:focus-visible) .file-drop {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.selected-files-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.selected-files-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.selected-files-list .file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-files-list .file-size {
  color: var(--muted);
  flex-shrink: 0;
}

.form-actions {
  padding-top: 0.25rem;
}

/* Mesaje de stare */
.form-status-box,
.ticket-status-result {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: none;
}

.form-status-box.success-msg,
.form-status-box.error-msg,
.ticket-status-result.show {
  display: block;
}

.form-status-box.success-msg {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok-text);
}

.form-status-box.error-msg,
.ticket-status-result.error {
  background: var(--err-bg);
  border-color: var(--err-line);
  color: var(--err-text);
}

.ticket-status-result.info {
  background: var(--navy-tint);
  color: var(--navy);
}

.status-heading {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.ticket-number-big {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ticket-status-result.success {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.status-details {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.status-details dt {
  color: var(--muted);
}

.status-details dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--navy-tint);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.875rem;
}

/* FAQ */
.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.faq-question:hover,
.faq-question[aria-expanded="true"] {
  color: var(--navy);
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
  color: var(--navy);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.faq-answer > p {
  overflow: hidden;
  color: var(--muted);
  max-width: 62ch;
}

.faq-question[aria-expanded="true"] + .faq-answer {
  grid-template-rows: 1fr;
}

.faq-question[aria-expanded="true"] + .faq-answer > p {
  padding-bottom: 1.35rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 1.75rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}

.footer-link {
  overflow-wrap: anywhere;
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Modal status ticket */
.ticket-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.ticket-modal[hidden] {
  display: none;
}

.ticket-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 33, 61, 0.45);
  backdrop-filter: blur(3px);
}

.ticket-modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  box-shadow: 0 24px 64px -16px rgba(20, 33, 61, 0.35);
  animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.ticket-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
}

.ticket-modal-close svg {
  width: 20px;
  height: 20px;
}

.ticket-modal-close:hover {
  background: var(--paper);
  color: var(--ink);
}

.ticket-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.ticket-modal-description {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  padding-right: 1.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-container,
  .contact-container,
  .faq-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-intro {
    position: static;
  }
}

@media (max-width: 780px) {
  .nav-link {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-container {
    min-height: 64px;
  }

  .brand-logo {
    height: 34px;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .help-option {
    padding: 1.1rem 1.15rem;
  }

  .form-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
