/* ========================================
   MyLibrary — Design System
   Palette from the React Native frontend
   ======================================== */

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

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1A0F0A;
  background-color: #FAF7F2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #6B4226; text-decoration: none; }
a:hover { color: #3D2314; text-decoration: underline; }

/* ---- Container ---- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Header ---- */
.header {
  background: #FFFFFF;
  border-bottom: 1px solid #E0D8CC;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: #3D2314;
  text-decoration: none;
}

.header__logo:hover {
  text-decoration: none;
  color: #3D2314;
}

.header__links {
  display: flex;
  list-style: none;
  gap: 24px;
}

.header__links a {
  font-size: 14px;
  font-weight: 500;
  color: #6B5B4E;
  text-decoration: none;
}

.header__links a:hover {
  color: #3D2314;
}

/* Hamburger toggle (mobile) */
.header__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.header__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #3D2314;
  border-radius: 2px;
}

/* ---- Main ---- */
.main {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 48px;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 48px 0;
}

.hero__content {
  max-width: 640px;
  margin: 0 auto;
}

.hero__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: #3D2314;
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: 16px;
  color: #6B5B4E;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Section ---- */
.section {
  padding: 32px 0;
}

.section--muted {
  background: #F0EBE3;
  border-radius: 12px;
  padding: 32px;
  margin: 32px 0;
}

.section__title {
  font-size: 22px;
  font-weight: 700;
  color: #3D2314;
  margin-bottom: 24px;
}

.section__title--page {
  font-size: 28px;
  margin-bottom: 8px;
}

.section__lead {
  font-size: 16px;
  color: #6B5B4E;
  margin-bottom: 32px;
  max-width: 640px;
}

/* ---- Cards grid ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: #FFFFFF;
  border: 1px solid #E0D8CC;
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(61, 35, 20, 0.08);
}

.card__icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.card__title {
  font-size: 18px;
  font-weight: 600;
  color: #3D2314;
  margin-bottom: 8px;
}

.card__text {
  font-size: 14px;
  color: #6B5B4E;
  line-height: 1.7;
}

/* ---- CTA ---- */
.cta {
  text-align: center;
}

.cta__title {
  font-size: 22px;
  font-weight: 700;
  color: #3D2314;
  margin-bottom: 12px;
}

.cta__text {
  font-size: 15px;
  color: #6B5B4E;
  margin-bottom: 24px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover { text-decoration: none; }

.btn--primary {
  background: #3D2314;
  color: #FFFFFF;
  border-color: #3D2314;
}

.btn--primary:hover {
  background: #6B4226;
  border-color: #6B4226;
  color: #FFFFFF;
}

.btn--ghost {
  background: transparent;
  color: #3D2314;
  border-color: #C4956A;
}

.btn--ghost:hover {
  background: #C4956A;
  color: #FFFFFF;
}

/* ---- Download page ---- */
.download {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
}

.download__qr {
  text-align: center;
}

.download__qr img {
  border-radius: 12px;
  background: #FFFFFF;
  padding: 8px;
  border: 1px solid #E0D8CC;
}

.download__qr-label {
  margin-top: 8px;
  font-size: 13px;
  color: #A8988B;
}

.download__info {
  flex: 1;
  min-width: 200px;
}

.download__note {
  margin-top: 12px;
  font-size: 13px;
  color: #A8988B;
}

/* ---- Form ---- */
.form {
  max-width: 520px;
}

.form__field {
  display: block;
  margin-bottom: 20px;
}

.form__label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #6B5B4E;
  margin-bottom: 6px;
}

.form__input {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  color: #1A0F0A;
  background: #F0EBE3;
  border: 1px solid #E0D8CC;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.form__input:focus {
  border-color: #C4956A;
}

.form__textarea {
  resize: vertical;
  min-height: 120px;
}

.form__errors {
  list-style: none;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #FEF0EF;
  border: 1px solid #C0392B;
  border-radius: 8px;
  font-size: 14px;
  color: #C0392B;
}

.form__errors li + li {
  margin-top: 4px;
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
}

.alert--success {
  background: #E8F5E9;
  border: 1px solid #4A7C59;
  color: #2E5E3A;
}

/* ---- FAQ ---- */
.faq {
  max-width: 640px;
}

.faq__item {
  border: 1px solid #E0D8CC;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #FFFFFF;
}

.faq__question {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #3D2314;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "+";
  font-size: 20px;
  color: #C4956A;
  transition: transform 0.2s;
}

.faq__item[open] .faq__question::after {
  content: "−";
}

.faq__answer {
  padding: 0 20px 16px;
  font-size: 14px;
  color: #6B5B4E;
  line-height: 1.7;
}

/* ---- Prose (legal pages) ---- */
.prose h2 {
  font-size: 20px;
  color: #3D2314;
  margin-top: 32px;
  margin-bottom: 12px;
}

.prose p {
  margin-bottom: 16px;
  color: #6B5B4E;
}

.prose ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.prose li {
  margin-bottom: 6px;
  color: #6B5B4E;
}

.prose ul li {
  list-style: disc;
}

.prose a {
  color: #6B4226;
  text-decoration: underline;
}

.prose .section__lead {
  margin-bottom: 32px;
}

/* ---- Footer ---- */
.footer {
  background: #3D2314;
  color: #E8D5C0;
  margin-top: auto;
}

.footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 32px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__col strong {
  font-size: 14px;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.footer__col a {
  font-size: 13px;
  color: #C4A88E;
  text-decoration: none;
}

.footer__col a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer__tagline {
  font-size: 13px;
  color: #A8988B;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
}

.footer__bottom p {
  font-size: 12px;
  color: #8A7A6E;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .header__links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #FFFFFF;
    border-bottom: 1px solid #E0D8CC;
    padding: 8px 0;
    gap: 0;
  }

  .header__links.open {
    display: flex;
  }

  .header__links a {
    display: block;
    padding: 12px 16px;
  }

  .header__toggle {
    display: flex;
  }

  .hero {
    padding: 32px 0;
  }

  .hero__title {
    font-size: 24px;
  }

  .section__title--page {
    font-size: 24px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .download {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}
