/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
body {
  margin: 0px;
  font-family: "Nunito", sans-serif;
}

a {
  color: var(--color-primary);
}

.app-body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.app-main { flex: 1; }

  .danger-zone {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid #e8c4b8;
  border-radius: 14px;
}

.danger-zone h3 { color: #b03a2e; margin-top: 0; }

.btn-danger {
  background: #b03a2e;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  font-family: "Nunito", sans-serif;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-header h1 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: var(--color-ink);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.title-row .back-button { flex-shrink: 0; }

.title-row h1 {
  min-width: 0;
  overflow-wrap: anywhere;
  margin-top: 0;
}

.dashboard-header > .menu { flex-shrink: 0; }

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: solid 2px var(--color-secondary);
  background: #fff;
  color: #2b1e1a; /* même teinte foncée que le titre */
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.back-button:hover {
  background: #ebe6db;
}

.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.child-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.15s ease;
}

.child-card:hover {
  transform: translateY(-3px);
}

.child-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-ink);
}

.child-meta {
  font-size: 0.85rem;
  color: var(--color-secondary);
}

.word-item {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.word-content {
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  color: var(--color-ink);
}

.word-date {
  font-size: 0.8rem;
  color: var(--color-secondary);
}

.word-actions a {
  font-size: 0.8rem;
  color: var(--color-primary);
  margin-left: 0.8rem;
  text-decoration: none;
}

.word-baby-version {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.word-real-meaning {
  font-family: "Nunito", sans-serif;
  color: var(--color-ink);
  opacity: 0.75;
}

.word-context {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-ink);
  opacity: 0.6;
  margin: 0.4rem 0;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
}

.empty-state {
  text-align: center;
  color: var(--color-ink);
  opacity: 0.6;
  margin-top: 2rem;
}

.form-page {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.form-page h1 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #faf3ea;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.navbar-logo {
  height: 32px;
}

.navbar-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: #d2691e; /* terracotta */
  font-size: 1.1rem;
}

.account-menu {
  position: relative;
}

.account-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f4f1ea;
  color: #d2691e;
  cursor: pointer;
  list-style: none;
}
.account-icon::-webkit-details-marker {
  display: none;
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: 48px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  overflow: hidden;
  z-index: 10;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  text-align: left;
  font-family: "Nunito", sans-serif;
  color: #333;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.dropdown-item:hover {
  background: #f4f1ea;
}

/* Pages légales — politique de confidentialité, CGU, suppression de compte */
.legal {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  font-family: "Nunito", system-ui, sans-serif;
  color: #2b1e1a;
  line-height: 1.7;
}

.legal h1 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 2rem;
  color: #c85c33;
  margin-bottom: 0.5rem;
}

.legal h2 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.35rem;
  color: #2b1e1a;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ebe3d7;
  scroll-margin-top: 1.5rem;
}

.legal h3 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.05rem;
  color: #c85c33;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.legal h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal p { margin: 0 0 1rem; }
.legal ul, .legal ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal li { margin-bottom: 0.4rem; }
.legal strong { font-weight: 700; }
.legal a { color: #c85c33; }

.legal-meta {
  color: #7a6a60;
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.legal-toc {
  background: #faf3ea;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.legal-toc ol { margin: 0; padding-left: 1.25rem; }
.legal-toc li { margin-bottom: 0.3rem; }
.legal-toc a { text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }

.legal-table-wrapper {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 460px;
}

.legal th {
  background: #faf3ea;
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 700;
  border-bottom: 2px solid #ebe3d7;
}

.legal td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #ebe3d7;
  vertical-align: top;
}

.legal-contact {
  background: #faf3ea;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.legal-contact p { margin-bottom: 0.25rem; }

.legal-steps {
  counter-reset: legal-step;
  list-style: none;
  padding-left: 0;
}

.legal-steps li {
  counter-increment: legal-step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1rem;
}

.legal-steps li::before {
  content: counter(legal-step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #c85c33;
  color: #fff;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legal-warning {
  background: #fdf0ea;
  border-left: 4px solid #c85c33;
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}

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

.legal-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #c85c33;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.legal-back:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .legal { padding: 1.5rem 1rem 3rem; }
  .legal h1 { font-size: 1.6rem; }
  .legal h2 { font-size: 1.2rem; margin-top: 2.25rem; }
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2rem 1.25rem;
  border-top: 1px solid #ebe3d7;
  text-align: center;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.85rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}

.site-footer-links a {
  color: #c85c33;
  text-decoration: none;
}

.site-footer-links a:hover { text-decoration: underline; }

.site-footer-credit { color: #7a6a60; margin: 0; }

/* User show */
.account { max-width: 34rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.account__header h1 { font-family: "Fredoka", sans-serif; font-size: 1.9rem; margin: 0 0 .25rem; }
.account__subtitle { font-family: "Nunito", sans-serif; color: #7a6a63; margin: 0 0 1.75rem; }

.account__card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.account__card h2 { font-family: "Fredoka", sans-serif; font-size: 1.05rem; color: #e2725b; margin: 0 0 1rem; }
.account__card--quiet { background: #faf5f2; box-shadow: none; }

.account__list div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid #f0e8e4; }
.account__list div:last-child { border-bottom: 0; }
.account__list dt { font-family: "Nunito", sans-serif; color: #7a6a63; font-size: .9rem; }
.account__list dd { font-family: "Nunito", sans-serif; font-weight: 600; margin: 0; text-align: right; word-break: break-all; }

.account__stats { display: flex; gap: .75rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.account__stats li { flex: 1; text-align: center; background: #faf5f2; border-radius: .9rem; padding: .85rem .5rem; font-family: "Nunito", sans-serif; font-size: .8rem; color: #7a6a63; }
.account__number { display: block; font-family: "Fredoka", sans-serif; font-size: 1.6rem; color: #e2725b; line-height: 1.1; }

.account__children { list-style: none; padding: 0; margin: 0 0 1rem; font-family: "Nunito", sans-serif; }
.account__children li { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid #f0e8e4; }
.account__children li:last-child { border-bottom: 0; }
.account__children span { color: #7a6a63; font-size: .85rem; }

.account__last { font-family: "Nunito", sans-serif; font-size: .9rem; color: #7a6a63; margin: 0; }
.account__links { list-style: none; padding: 0; margin: 0; font-family: "Nunito", sans-serif; }
.account__links li { padding: .4rem 0; }

.account__actions { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.5rem; }

.button { display: block; text-align: center; padding: .8rem 1rem; border-radius: .9rem; font-family: "Nunito", sans-serif; font-weight: 600; text-decoration: none; }
.button--ghost { border: 1.5px solid #e2725b; color: #e2725b; }
.button--danger { color: #b3453a; }
.button--secondary { background-color: #e2725b; color: white; }
.button--full { flex-basis: 100%; }

/* form errors devise */
.form__errors {
  background: #fdf0ee;
  border-radius: .9rem;
  padding: .9rem 1rem;
  margin-bottom: 1.2rem;
}
.form__errors ul {
  margin: 0;
  padding-left: 1.1rem;
  font-family: "Nunito", sans-serif;
  font-size: .9rem;
  color: #b3453a;
}
.form__errors li { padding: .15rem 0; }

.flash {
  position: absolute;
  top: 3rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 34rem;
  margin: 0;
  padding: 1rem;
  border-radius: .9rem;
  z-index: 50;
}
.flash--notice { background: #eaf6ef; color: #2f6b47; }
.flash--alert  { background: #fdf0ee; color: #b3453a; }

/* Dashboard */
.dashboard-home {
  position: relative;
  min-height: 100%;
  background: linear-gradient(180deg, #faf3ea 0%, #fdf7f0 45%, #ffffff 100%);
  padding: 2rem 1rem 4rem;
  overflow: hidden;
}

.dashboard-welcome {
  text-align: center;
  margin-bottom: 2rem;
}

.rainbow-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: .75rem;
}

.rainbow { width: 96px; height: auto; }

.dashboard-welcome h1 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.9rem;
  color: var(--color-ink);
  margin: 0 0 .35rem;
}

.dashboard-last {
  font-family: "Nunito", sans-serif;
  font-size: .9rem;
  color: var(--color-secondary);
  margin: 0;
}

.quick-actions {
  display: grid;
  gap: .75rem;
  margin-bottom: 2rem;
}

.quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: transform .15s ease;
}

.quick-action:hover { transform: translateY(-2px); }
.quick-action__label { min-width: 0; overflow-wrap: anywhere; }
.quick-action__plus { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }

.quick-action--ghost {
  background: #fff;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  box-shadow: none;
  justify-content: center;
  font-size: 1rem;
}

.dashboard-link {
  display: block;
  text-align: center;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  color: var(--color-secondary);
  text-decoration: none;
}
