* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1a3a7a 0, #0b1933 45%, #02040a 100%);
  color: #f5f7ff;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Ascundere generică */

.hidden {
  display: none !important;
}

/* Ecran loading */

#loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0b1933, #142b57);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.loading-content {
  text-align: center;
}

/* Wrapper pentru logo + lumina animată */

.loading-logo-wrap {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 12px;
  padding: 8px 10px;
  background: radial-gradient(circle at bottom, rgba(0, 0, 0, 0.6), transparent 70%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.loading-logo {
  width: 220px;
  max-width: 70vw;
  display: block;
}

/* Lumina care urcă de jos în sus */

.loading-light {
  position: absolute;
  left: 0;
  bottom: -120%;
  width: 100%;
  height: 160%;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.65),
    transparent 65%
  );
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: loadingSweep 2.2s ease-in-out infinite;
}

@keyframes loadingSweep {
  0% {
    transform: translateY(60%);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  60% {
    transform: translateY(-10%);
    opacity: 1;
  }
  100% {
    transform: translateY(-35%);
    opacity: 0;
  }
}

.loading-text {
  margin-top: 18px;
  font-size: 1rem;
  color: #dbe6ff;
}

/* App wrapper */

#app {
  width: 100%;
  max-width: 960px;
  padding: 20px;
}

/* Header */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 20px;
  background: linear-gradient(120deg, rgba(10, 38, 90, 0.9), rgba(11, 52, 128, 0.9));
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.header-logo {
  height: 48px;
  width: auto;
}

.header-center {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffd200;
  text-align: center;
}

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

/* Buton ADMIN ca icon cu UserAdmin.png */

.btn-admin-login {
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 50% !important;
  border: none !important;
  background: transparent url("UserAdmin.png") center/contain no-repeat !important;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  font-size: 0;      /* ascunde textul "Admin" */
  color: transparent;
}

.btn-admin-login::before {
  content: "";
}

.btn-admin-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.65);
}

/* Buton POWER – folosind GreenButton.png și RedButton.png */

.power-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
  transition: transform 0.1s ease, box-shadow 0.18s ease;
}

.power-btn::before {
  content: "";
}

.power-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.85);
}

/* Stare inactiv (verde – chestionar oprit, apăsare pentru PORNIRE) */
.power-off {
  background-image: url("GreenButton.png");
}

/* Stare activ (roșu – chestionar pornit, apăsare pentru OPRIRE) */
.power-on {
  background-image: url("RedButton.png");
}

/* Main layout */

.app-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card */

.card {
  background: rgba(6, 18, 45, 0.95);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

/* Fundal automotive */

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 210, 0, 0.12), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(0, 173, 239, 0.16), transparent 55%),
    linear-gradient(120deg, transparent 0, transparent 35%, rgba(255, 255, 255, 0.08) 38%, transparent 42%, transparent 100%);
  opacity: 0.9;
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -10%;
  width: 120%;
  height: 120px;
  background:
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.18),
      rgba(255, 255, 255, 0.18) 20px,
      transparent 20px,
      transparent 40px
    );
  opacity: 0.06;
  transform: skewX(-18deg);
  pointer-events: none;
}

/* Text intro */

#intro-card h1 {
  font-size: 1.9rem;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

#intro-card h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: #ffd200;
  position: relative;
  z-index: 1;
}

.intro-text {
  font-size: 0.95rem;
  max-width: 520px;
  margin-bottom: 10px;
  color: #d8e4ff;
  position: relative;
  z-index: 1;
}

.active-client-display {
  font-size: 0.9rem;
  margin-bottom: 16px;
  color: #c6d4ff;
  position: relative;
  z-index: 1;
}

/* Butoane */

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease, opacity 0.2s ease;
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #0054a6, #00a1ff);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 161, 255, 0.5);
}

.btn-primary:hover:not(.btn-disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 161, 255, 0.7);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e7ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-secondary:hover:not(.btn-disabled) {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Animatie buton START */

#start-btn {
  font-size: 1.05rem;
  padding: 12px 32px;
  margin-bottom: 8px;
  animation: pulse 1.6s infinite;
}

.btn-disabled#start-btn {
  animation: none;
}

@keyframes pulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 24px rgba(0, 161, 255, 0.5);
  }
  50% {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 161, 255, 0.9);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 24px rgba(0, 161, 255, 0.5);
  }
}

.start-info {
  font-size: 0.85rem;
  color: #ffb3b3;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* Quiz card */

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

#question-counter {
  font-size: 0.9rem;
  color: #dbe6ff;
}

#timer {
  font-size: 0.9rem;
  color: #ffd200;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

/* Răspunsuri */

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.answer-option {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(9, 26, 70, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.answer-option:hover {
  background: rgba(18, 44, 105, 0.95);
  transform: translateY(-1px);
}

.answer-option input[type="radio"] {
  margin-top: 3px;
}

.answer-text {
  font-size: 0.95rem;
  color: #e2e7ff;
}

/* Progres */

.progress-wrapper {
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.progress-label {
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: #c6d4ff;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd200, #00d6ff);
  transition: width 0.2s ease;
}

/* Acțiuni quiz */

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

/* Rezultat */

#result-card h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

#final-score-text,
#final-extra-text {
  margin-bottom: 10px;
  font-size: 0.98rem;
  position: relative;
  z-index: 1;
}

/* Modal generic */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 5000;
  padding: 10px;
  overflow-y: auto;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
}

.modal-content {
  position: relative;
  background: #071227;
  border-radius: 16px;
  padding: 22px 20px;
  width: 100%;
  max-width: 900px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
}

.modal-content h2 {
  margin-bottom: 12px;
  font-size: 1.3rem;
}

/* Modal PAROLĂ admin */

.password-modal-content {
  max-width: 420px;
}

.password-modal-text {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #dbe6ff;
}

.password-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.password-modal-field label {
  font-size: 0.85rem;
  color: #c6d4ff;
}

.password-modal-field input {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(4, 16, 40, 0.9);
  color: #f5f7ff;
  font-size: 0.95rem;
  outline: none;
}

.password-modal-field input:focus {
  border-color: #00a1ff;
  box-shadow: 0 0 0 1px rgba(0, 161, 255, 0.4);
}

.password-modal-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.password-error {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #ff8080;
}

/* Secțiuni admin */

.admin-section {
  margin-bottom: 16px;
  font-size: 0.92rem;
  color: #e2e7ff;
}

.admin-section h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

#stat-worst-questions {
  padding-left: 18px;
}

/* Gestionare clienți */

.client-manage-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.client-manage-row select {
  flex: 1;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(4, 16, 40, 0.9);
  color: #e2e7ff;
  font-size: 0.9rem;
}

.client-add-row {
  display: flex;
  gap: 8px;
}

.client-add-row input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(4, 16, 40, 0.9);
  color: #e2e7ff;
  font-size: 0.9rem;
}

/* Grafice admin */

.admin-charts {
  margin-top: 8px;
}

.charts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}

.chart-box {
  flex: 1 1 260px;
  background: rgba(4, 16, 40, 0.9);
  border-radius: 12px;
  padding: 10px 10px 16px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-title {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #c6d4ff;
}

.chart-box canvas {
  width: 100%;
  max-height: 220px;
}

/* Lista rapoarte */

.reports-list {
  font-size: 0.9rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.report-year {
  font-weight: 600;
  margin-top: 6px;
}

.report-month {
  margin-left: 10px;
  margin-top: 2px;
  font-weight: 500;
}

.report-client {
  margin-left: 20px;
  margin-top: 2px;
}

/* Butoane admin */

.admin-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.admin-hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #9fb3ff;
}

/* Editor întrebări (containere – dacă le folosești) */

.questions-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.questions-editor-container {
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 6px 4px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(4, 16, 40, 0.8);
}

/* Responsive */

@media (max-width: 640px) {
  /* Antet pe telefon */

  .app-header {
    position: relative;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 16px 12px;
    gap: 8px;
  }

  /* Logo centrat sus în antet */
  .header-left {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Titlul rămâne centrat și pe un rând propriu */
  .header-center {
    width: 100%;
    text-align: center;
    margin-top: 12px;
  }

  /* POWER în stânga, ADMIN în dreapta, pe aceeași linie */
  .header-right {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    padding: 0 12px;
    display: flex;
    justify-content: space-between;  /* Power stânga, Admin dreapta */
    align-items: center;
  }

  .power-btn {
    flex: 0 0 auto;
  }

  .btn-admin-login {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Butoanele de navigare din chestionar - pe o coloană, full width,
     dar FĂRĂ să mai forțăm toate .btn din site */
  .quiz-actions {
    flex-direction: column;
    gap: 8px;
  }

  .quiz-actions .btn {
    width: 100%;
    text-align: center;
  }

  /* Grafice și form-urile din admin pe o singură coloană */
  .charts-row {
    flex-direction: column;
  }

  .client-manage-row,
  .client-add-row {
    flex-direction: column;
  }
}
