:root {
  --bg: #011a52;
  --card-bg: #03236b;
  --surface-shaded: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(1, 177, 237, 0.14);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.72);
  --primary: #011a52;
  --secondary: #01b1ed;
  --secondary-hover: #009cd1;
  --border: rgba(255, 255, 255, 0.16);
  --radius: 14px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.quiz-container {
  width: 90vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

header {
  margin-bottom: clamp(0.5rem, 1vw, 1.25rem);
  flex-shrink: 0;
}

header h1 {
  font-size: clamp(15px, 2vw, 2.5rem);
  font-weight: 700;
  margin-bottom: clamp(0.35rem, 0.6vw, 0.75rem);
  text-align: center;
  color: var(--text-main);
}

.progress-bar-container {
  width: 100%;
  max-width: clamp(180px, 22vw, 380px);
  height: clamp(6px, 0.6vw, 12px);
  background-color: var(--surface-shaded);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto clamp(0.25rem, 0.5vw, 0.6rem);
}

.progress-bar {
  height: 100%;
  width: 12.5%;
  background-color: var(--secondary);
  transition: width 0.25s ease;
}

.question-counter {
  font-size: clamp(15px, 1.1vw, 1.25rem);
  color: var(--text-muted);
  text-align: center;
}

.card {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: none;
}

#question-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.question-text {
  font-size: clamp(15px, 3vw, 4rem);
  line-height: 1.3;
  margin-bottom: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-main);
}

/* Horizontalni ekrani: lijevo-desno jedna pored druge u sredini ekrana */
.options-container {
  --options-gap: clamp(1.5rem, 3vw, 4rem);
  flex: 1;
  min-height: 0;
  container-type: size;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--options-gap);
}

.option-btn {
  --img-size: min(
    calc((100cqw - var(--options-gap)) / 2),
    calc(100cqh - 4.5em - 1.25rem)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: var(--img-size);
  max-height: 100%;
  min-height: 0;
  text-align: center;
  padding: 0.25rem;
  background: transparent;
  border: none;
  border-radius: 12px;
  font-size: clamp(15px, 2vw, 2.75rem);
  line-height: 1.25;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}

.option-btn:hover {
  color: var(--secondary);
}

.option-btn:active {
  transform: scale(0.99);
}

.option-img-wrapper {
  width: var(--img-size);
  height: var(--img-size);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.option-img {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: none;
  display: block;
}

.option-content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
}

/* Vertikalni ekrani (mobitel, tablet): jedna ispod druge, visina pitanja bez headera */
@media (orientation: portrait), (max-width: 768px) {
  body {
    align-items: flex-start;
  }

  .quiz-container {
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 0.75rem 1rem;
  }

  #question-section {
    flex: none;
    height: 94vh;
    height: 94dvh;
  }

  .options-container {
    --options-gap: 1.25rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .card {
    padding: 0.5rem 0;
  }

  .question-text {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .option-btn {
    --img-size: min(
      100cqw,
      calc((100cqh - var(--options-gap)) / 2 - 3em - 0.75rem)
    );
    width: 100%;
    padding: 0.25rem 0;
  }
}

/* Result Styles */
#result-section {
  text-align: center;
  max-width: 600px;
  width: 100%;
  margin: auto;
  max-height: 100%;
  overflow-y: auto;
}

.result-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background-color: var(--surface-hover);
  color: var(--secondary);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 0.75rem;
}

.result-title {
  font-size: clamp(15px, 2.5vw, 2.5rem);
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.result-score {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.result-description {
  font-size: clamp(15px, 1.4vw, 1.35rem);
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.restart-btn,
.submit-btn {
  padding: 0.85rem 1.75rem;
  background-color: var(--secondary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: clamp(15px, 1.3vw, 1.2rem);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.restart-btn:hover,
.submit-btn:hover {
  background-color: var(--secondary-hover);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Form Styles */
.user-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  margin-top: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background-color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(1, 177, 237, 0.25);
}

.user-form .submit-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* License ID Box */
.license-box {
  margin-top: 1.25rem;
  padding: 1.5rem;
  background-color: var(--surface-shaded);
  border: 2px dashed var(--secondary);
  border-radius: 12px;
}

.license-label {
  font-size: clamp(15px, 1.2vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.license-id {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--secondary);
}
