:root {
  --green-dark: #2E7D32;
  --green-light: #A5D6A7;
  --bg-light: #F5F9F5;
  --text: #1B2B1C;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Roboto', 'Open Sans', Arial, sans-serif;
  color: var(--text);
  background: var(--bg-light);
  line-height: 1.5;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--green-dark); }

/* Header */
.hero {
  background: var(--green-dark);
  color: var(--white);
  text-align: center;
  padding: 70px 0 60px;
}
.hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
}
.hero__subtitle {
  margin: 0 0 28px;
  font-size: 1.1rem;
  opacity: 0.95;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn--primary {
  background: var(--white);
  color: var(--green-dark);
}
.btn--primary:hover { background: var(--green-light); }
.btn--primary:active { transform: scale(0.98); }
.btn--text {
  background: none;
  color: var(--green-dark);
  text-decoration: underline;
  padding: 6px 4px;
  font-size: 0.9rem;
}
.btn--disabled {
  background: #BDBDBD;
  color: #757575;
  cursor: not-allowed;
}

.section { padding: 48px 0; }
.section__title {
  color: var(--green-dark);
  font-size: 1.5rem;
  margin: 0 0 16px;
}

/* About */
.about { background: var(--white); }
.about__inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.about__icon { font-size: 2.5rem; line-height: 1; }

/* Tasks */
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.task-card {
  background: var(--white);
  border: 1px solid var(--green-light);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.task-card.is-done {
  background: var(--green-light);
  border-color: var(--green-dark);
}
.task-card__info { flex: 1 1 280px; }
.task-card__day {
  font-weight: 700;
  color: var(--green-dark);
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.task-card__text { margin: 2px 0 0; }
.task-card__btn {
  flex-shrink: 0;
  background: var(--bg-light);
  border: 2px solid var(--green-dark);
  color: var(--green-dark);
  border-radius: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
}
.task-card__btn.is-done {
  background: var(--green-dark);
  color: var(--white);
}

/* Progress */
.progress__inner { text-align: center; }
.progress-bar {
  background: var(--white);
  border: 1px solid var(--green-light);
  border-radius: 20px;
  height: 22px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--green-dark);
  transition: width 0.3s ease;
}
.progress__text {
  font-weight: 500;
  margin: 8px 0 24px;
}

#resetBtn { margin-top: 16px; }

/* Certificate */
.certificate {
  background: var(--white);
  text-align: center;
}

/* Footer */
.footer {
  background: var(--green-dark);
  color: var(--white);
  padding: 28px 0;
}
.footer__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer__link {
  color: var(--white);
  text-decoration: underline;
}
.footer__copy {
  margin: 12px 0 0;
  opacity: 0.85;
  font-size: 0.9rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal__box {
  background: var(--white);
  border-radius: 10px;
  padding: 24px;
  max-width: 360px;
  text-align: center;
}
.modal__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.modal__title {
  margin: 0 0 16px;
  color: var(--green-dark);
}
.modal__error {
  color: #C62828;
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.field {
  display: block;
  text-align: left;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.field input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--green-light);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}
.field input:focus {
  outline: 2px solid var(--green-dark);
}

/* Certificate template (rasterized for PDF export, kept off-screen) */
.cert-template {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1000px;
  height: 700px;
  background: var(--white);
  font-family: 'Roboto', Arial, sans-serif;
}
.cert-template__border {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 6px solid var(--green-dark);
  padding: 50px 70px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.cert-template__label {
  margin: 0;
  color: var(--green-dark);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.cert-template__subtitle {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
}
.cert-template__given {
  margin: 10px 0 0;
  font-size: 1rem;
  color: var(--text);
}
.cert-template__name {
  margin: 0;
  font-size: 2.2rem;
  color: var(--green-dark);
  border-bottom: 2px solid var(--green-light);
  padding-bottom: 10px;
}
.cert-template__result {
  margin: 10px 0 0;
  font-size: 1.2rem;
}
.cert-template__email {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
}
.cert-template__footer {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #777;
}

@media (max-width: 480px) {
  .task-card { flex-direction: column; align-items: stretch; }
  .task-card__btn { width: 100%; }
}
