/* ============================================================
   MINI-KURZ PYTHONU — SDÍLENÉ STYLY
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --c-dark:         #343e57;
  --c-accent:       #fbcd0c;
  --c-bg:           #f2f2ee;
  --c-white:        #ffffff;
  --c-muted:        #868ea9;
  --c-border:       #d8d8d4;
  --c-accent-light: #f8e9ab;
  --c-success:      #2e7d32;
  --c-error:        #cf3629;

  --f-display: 'Red Hat Display', sans-serif;
  --f-text:    'Red Hat Text', sans-serif;
  --f-mono:    'Fira Code', 'Consolas', 'Monaco', monospace;

  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;

  --radius: 4px;
  --radius-lg: 8px;
  --max-w: 720px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-text);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-dark);
  background-color: var(--c-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--f-display);
  line-height: 1.2;
  color: var(--c-dark);
}

h1 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; }
h2 { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--s-3);
}

.main {
  flex: 1;
  padding-block: var(--s-4);
}

/* --- Label --- */
.label {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: var(--c-accent);
  color: var(--c-dark);
  padding: 0.25em 0.65em;
  border-radius: var(--radius);
  margin-bottom: var(--s-1);
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.7rem 1.6rem;
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover {
  filter: brightness(0.92);
}

.btn:active {
  transform: scale(0.98);
}

.btn--accent {
  background-color: var(--c-accent);
  color: var(--c-dark);
}

.btn--outline {
  background-color: transparent;
  color: var(--c-muted);
  border: 1.5px solid var(--c-border);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1.2rem;
}

.btn--outline:hover {
  border-color: var(--c-dark);
  color: var(--c-dark);
  filter: none;
}

.btn--large {
  padding: 0.9rem 2rem;
  font-size: 1.1rem;
}

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

/* --- Header --- */
.header {
  background-color: var(--c-white);
  border-bottom: 1.5px solid var(--c-border);
  padding-block: var(--s-2);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.header__logo {
  height: 2rem;
  width: auto;
}

.header__day {
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-muted);
}

/* --- Footer --- */
.footer {
  background-color: var(--c-dark);
  color: rgba(255, 255, 255, 0.5);
  padding-block: var(--s-3);
  text-align: center;
  font-size: 0.8rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
}

.footer a:hover {
  color: var(--c-accent);
}

/* ============================================================
   SANDBOX
   ============================================================ */
.sandbox__intro {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--c-muted);
  margin-bottom: var(--s-3);
}

.sandbox__editor-wrap {
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--s-2);
}

.sandbox__editor-wrap .cm-editor {
  font-size: 0.95rem;
  min-height: 140px;
}

.sandbox__editor-wrap .cm-editor.cm-focused {
  outline: none;
}

.sandbox__editor-wrap .cm-scroller {
  font-family: var(--f-mono);
  line-height: 1.6;
  padding: var(--s-1) 0;
}

.sandbox__toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
  flex-wrap: wrap;
}

.sandbox__status {
  font-size: 0.85rem;
  color: var(--c-muted);
}

.sandbox__output-label {
  font-size: 0.9rem;
  color: var(--c-muted);
  margin-bottom: var(--s-1);
  font-weight: 500;
}

.sandbox__output {
  background-color: var(--c-dark);
  color: #e0e0e0;
  font-family: var(--f-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: var(--s-3);
  border-radius: var(--radius-lg);
  min-height: 80px;
  white-space: pre-wrap;
  word-break: break-word;
}

.sandbox__output--error {
  color: #ff8a80;
}

.sandbox__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-5) 0;
  color: var(--c-muted);
  font-size: 0.95rem;
}

.sandbox__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Sandbox: Explanation --- */
.sandbox__explanation {
  background-color: var(--c-white);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
  margin-top: var(--s-3);
  margin-bottom: var(--s-3);
  font-size: 0.95rem;
  line-height: 1.7;
}

.sandbox__explanation p {
  margin-bottom: var(--s-2);
}

.sandbox__explanation p:last-child {
  margin-bottom: 0;
}

/* --- Shared code styling across sandbox sections --- */
.sandbox__explanation code,
.sandbox__explore-question code,
.sandbox__hint p code,
.sandbox__task-section code {
  font-family: var(--f-mono);
  font-size: 0.88em;
  background-color: #f5f0e0;
  padding: 0.15em 0.4em;
  border-radius: var(--radius);
  color: var(--c-dark);
  overflow-wrap: break-word;
  word-break: break-word;
}

/* --- Sandbox: Explore --- */
.sandbox__explore {
  margin-top: var(--s-4);
}

.sandbox__explore h2 {
  margin-bottom: var(--s-2);
}

.sandbox__explore-question {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: var(--s-1);
}

/* --- Sandbox: Task section --- */
.sandbox__task-section {
  margin-top: var(--s-4);
}

.sandbox__task-section h2 {
  margin-bottom: var(--s-2);
}

.sandbox__task-section > p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: var(--s-2);
}

/* --- Sandbox: Hints (details/summary) --- */
.sandbox__hint {
  background-color: var(--c-white);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--s-2);
  overflow-x: auto;
}

.sandbox__hint summary {
  padding: var(--s-2) var(--s-3);
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
  transition: background-color 0.15s ease;
}

.sandbox__hint summary::-webkit-details-marker {
  display: none;
}

.sandbox__hint summary::before {
  content: '';
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid var(--c-muted);
  border-bottom: 2px solid var(--c-muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sandbox__hint[open] summary::before {
  transform: rotate(45deg);
}

@media (hover: hover) {
  .sandbox__hint summary:hover {
    background-color: var(--c-bg);
  }
}

.sandbox__hint > p {
  padding: 0 var(--s-3) var(--s-3);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--c-muted);
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz__progress {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.quiz__progress-bar {
  flex: 1;
  height: 6px;
  background-color: var(--c-border);
  border-radius: 3px;
  overflow: hidden;
}

.quiz__progress-fill {
  height: 100%;
  background-color: var(--c-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.quiz__progress-text {
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-muted);
  white-space: nowrap;
}

.quiz__card {
  background-color: var(--c-white);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-3);
}

.quiz__question-text {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--s-2);
}

.quiz__code {
  background-color: var(--c-dark);
  color: #e0e0e0;
  font-family: var(--f-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
  margin-bottom: var(--s-3);
  overflow-x: auto;
  white-space: pre;
}

.quiz__answers {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  list-style: none;
}

.quiz__answer {
  padding: var(--s-2) var(--s-3);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  line-height: 1.5;
}

.quiz__answer:hover:not(.quiz__answer--disabled) {
  border-color: var(--c-dark);
  background-color: var(--c-bg);
}

.quiz__answer--correct {
  border-color: var(--c-success);
  background-color: #e8f5e9;
}

.quiz__answer--wrong {
  border-color: var(--c-error);
  background-color: #ffebee;
}

.quiz__answer--disabled {
  cursor: default;
  opacity: 0.7;
}

.quiz__answer--disabled.quiz__answer--correct {
  opacity: 1;
}

.quiz__answer code {
  font-family: var(--f-mono);
  font-size: 0.88em;
  background-color: var(--c-bg);
  padding: 0.15em 0.4em;
  border-radius: var(--radius);
}

.quiz__feedback {
  margin-top: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}

.quiz__feedback--correct {
  display: block;
  background-color: #e8f5e9;
  border-left: 3px solid var(--c-success);
}

.quiz__feedback--wrong {
  display: block;
  background-color: #ffebee;
  border-left: 3px solid var(--c-error);
}

.quiz__feedback-label {
  font-family: var(--f-display);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.quiz__next {
  margin-top: var(--s-3);
  display: none;
}

.quiz__next--visible {
  display: block;
}

/* --- Quiz Results --- */
.quiz__results {
  text-align: center;
}

.quiz__score {
  font-family: var(--f-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--c-accent);
  margin-bottom: var(--s-1);
}

.quiz__score-label {
  font-size: 0.95rem;
  color: var(--c-muted);
  margin-bottom: var(--s-3);
}

.quiz__message {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--s-4);
}

/* --- Quiz CTA (den 5) --- */
.quiz__cta {
  background-color: var(--c-accent-light);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-3);
  margin-top: var(--s-4);
  text-align: center;
}

.quiz__cta p {
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--s-3);
  font-size: 1rem;
  line-height: 1.7;
}

.quiz__testimonial {
  border-left: 3px solid var(--c-accent);
  padding-left: var(--s-3);
  margin-top: var(--s-4);
  max-width: 48ch;
  margin-inline: auto;
  text-align: left;
}

.quiz__testimonial p {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.quiz__testimonial cite {
  display: block;
  margin-top: var(--s-1);
  font-style: normal;
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-muted);
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing__hero {
  background-color: var(--c-white);
  padding-block: var(--s-5);
}

.landing__lead {
  font-size: 1.05rem;
  color: var(--c-muted);
  margin-top: var(--s-2);
  max-width: 52ch;
}

/* --- Landing: Form --- */
.landing__form {
  margin-top: var(--s-4);
}

.landing__form-row {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.landing__form-input {
  flex: 1;
  padding: 0.7rem 1rem;
  font-family: var(--f-text);
  font-size: 1rem;
  color: var(--c-dark);
  background-color: var(--c-white);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease;
  min-width: 0;
}

.landing__form-input::placeholder {
  color: #aaa;
}

.landing__form-input:focus {
  border-color: var(--c-dark);
}

.landing__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: var(--s-2);
  font-size: 0.8rem;
  color: var(--c-muted);
  line-height: 1.5;
  cursor: pointer;
}

.landing__consent input[type="checkbox"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.landing__consent a {
  color: var(--c-muted);
  text-decoration: underline;
}

.landing__consent a:hover {
  color: var(--c-dark);
}

/* --- Landing: Days --- */
.landing__days {
  padding-block: var(--s-5);
}

.landing__days h2 {
  margin-bottom: var(--s-3);
}

.landing__day-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.landing__day-item {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  padding: var(--s-2) var(--s-3);
  background-color: var(--c-white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--c-border);
}

.landing__day-num {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--c-dark);
  background-color: var(--c-accent);
  padding: 0.2em 0.6em;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
}

.landing__day-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --- Landing: Quotes --- */
.landing__quotes {
  background-color: var(--c-white);
  padding-block: var(--s-5);
}

.landing__quotes h2 {
  margin-bottom: var(--s-3);
}

.landing__quote-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.landing__quote {
  border-left: 3px solid var(--c-accent);
  padding-left: var(--s-3);
}

.landing__quote p {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
}

.landing__quote cite {
  display: block;
  margin-top: var(--s-1);
  font-style: normal;
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-muted);
}

/* --- Landing: About --- */
.landing__about {
  padding-block: var(--s-5);
}

.landing__about-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.landing__about-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
  margin-inline: auto;
}

.landing__about-text p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--c-muted);
  max-width: 52ch;
}

/* --- Landing: Bottom CTA --- */
.landing__bottom-cta {
  background-color: var(--c-accent-light);
  padding-block: var(--s-5);
  text-align: center;
}

.landing__bottom-cta h2 {
  margin-bottom: var(--s-2);
}

.landing__bottom-cta p {
  color: var(--c-muted);
  margin-bottom: var(--s-3);
}

/* ============================================================
   THANK-YOU PAGE
   ============================================================ */
.thankyou {
  text-align: center;
  padding-block: var(--s-5);
}

.thankyou h1 {
  margin-bottom: var(--s-3);
}

.thankyou p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--c-muted);
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--s-2);
}

.thankyou a {
  color: var(--c-dark);
  text-decoration: underline;
}

.thankyou a:hover {
  color: var(--c-accent);
}

/* ============================================================
   LANDING PAGE FOOTER
   ============================================================ */
.footer--landing {
  font-size: 0.75rem;
}

.footer--landing p {
  margin-bottom: 0.3rem;
}

.footer--landing a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
  .quiz__card {
    padding: var(--s-4);
  }

  .quiz__cta {
    padding: var(--s-4);
  }

  .landing__form-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .landing__form-row .landing__form-input {
    flex: 1 1 40%;
    min-width: 140px;
  }

  .landing__form-row .btn {
    flex: 0 0 auto;
  }

  .landing__about-inner {
    flex-direction: row;
    align-items: center;
  }
}
