/* Version 12 — grille mobile compacte, quatre icônes par ligne. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --page: #02050e;
  --panel: rgba(10, 18, 36, 0.9);
  --panel-strong: #091225;
  --white: #f5f7ff;
  --text: #d9e1f4;
  --muted: #8798ba;
  --line: rgba(116, 139, 184, 0.22);
  --blue: #438cff;
  --gold: #ffbd32;
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #000208;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 3% 5%, rgba(235, 158, 31, 0.29), transparent 28rem),
    radial-gradient(circle at 53% -8%, rgba(33, 87, 177, 0.33), transparent 36rem),
    radial-gradient(circle at 100% 6%, rgba(18, 136, 130, 0.24), transparent 32rem),
    radial-gradient(circle at 70% 62%, rgba(67, 93, 172, 0.14), transparent 31rem),
    var(--page);
}

button,
input,
textarea {
  font: inherit;
}

.page {
  position: relative;
  width: min(1320px, calc(100% - 56px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(64px, 8vh, 96px) 0 38px;
  display: flex;
  flex-direction: column;
}

.intro-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.intro {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #8998b8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 25px;
  height: 1px;
  flex: 0 0 auto;
  background: linear-gradient(90deg, var(--gold), rgba(255, 189, 50, 0.1));
}

h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(3.4rem, 6vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

h1 em {
  display: inline-block;
  color: transparent;
  font-style: normal;
  background: linear-gradient(98deg, #3e8dff 8%, #73a4f5 42%, #e8c277 67%, #ffb729 92%);
  background-clip: text;
  -webkit-background-clip: text;
}

.lead {
  max-width: 600px;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.account-actions {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-form,
.account-form {
  margin: 0;
}

.logout-button,
.organize-button,
.motd-menu summary,
.account-menu summary {
  min-height: 46px;
  padding: 11px 18px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  background: rgba(13, 26, 47, 0.58);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.motd-menu summary,
.account-menu summary {
  display: flex;
  align-items: center;
  list-style: none;
  user-select: none;
}

.motd-menu summary::-webkit-details-marker,
.account-menu summary::-webkit-details-marker {
  display: none;
}

.logout-button:hover,
.organize-button:hover,
.motd-menu summary:hover,
.motd-menu[open] summary,
.account-menu summary:hover,
.account-menu[open] summary {
  color: var(--white);
  background: rgba(25, 42, 73, 0.76);
  border-color: rgba(112, 145, 203, 0.45);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(50px, 7vh, 70px);
}

.app-card {
  --accent: var(--blue);
  --accent-rgb: 67, 140, 255;
  position: relative;
  min-height: 285px;
  padding: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(140deg, rgba(var(--accent-rgb), 0.045), transparent 43%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 23px;
  box-shadow:
    inset 0 1px 0 rgba(var(--accent-rgb), 0.48),
    0 20px 55px rgba(0, 2, 10, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.app-card::after {
  content: "";
  position: absolute;
  top: -90px;
  left: -75px;
  width: 210px;
  height: 180px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.14), transparent 70%);
  transition: opacity 180ms ease;
}

.app-card:hover {
  transform: translateY(-5px);
  background-color: rgba(13, 24, 47, 0.98);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow:
    inset 0 1px 0 rgba(var(--accent-rgb), 0.75),
    0 25px 64px rgba(0, 2, 10, 0.32);
}

.app-card:hover::after {
  opacity: 1;
}

.app-card:focus-visible,
.primary-button:focus-visible,
.logout-button:focus-visible,
.organize-button:focus-visible,
.motd-menu summary:focus-visible,
.account-menu summary:focus-visible,
.order-controls button:focus-visible,
.panel-close:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.app-card--pap {
  --accent: #ffb522;
  --accent-rgb: 255, 181, 34;
}

.app-card--piano {
  --accent: #438cff;
  --accent-rgb: 67, 140, 255;
}

.app-card--reiki {
  --accent: #16c8bf;
  --accent-rgb: 22, 200, 191;
}

.app-card--anamae {
  --accent: #69d4ad;
  --accent-rgb: 105, 212, 173;
}

.app-card--anamae .app-icon {
  background: #092c2b;
}

.app-card--anamae .app-icon img {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.app-card--vinciacache {
  --accent: #cf72ed;
  --accent-rgb: 207, 114, 237;
}

.app-card--lectures {
  --accent: #8c91ff;
  --accent-rgb: 140, 145, 255;
}

.app-card--deep-focus {
  --accent: #e6b48c;
  --accent-rgb: 230, 180, 140;
}

.app-card--deep-focus .app-icon img {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.app-card--tempo {
  --accent: #ff7f66;
  --accent-rgb: 255, 127, 102;
}

.app-card--questmate {
  --accent: #59d88e;
  --accent-rgb: 89, 216, 142;
}

.app-card--bisou {
  --accent: #8cdb45;
  --accent-rgb: 140, 219, 69;
}

.app-card--planning {
  --accent: #5cc8e8;
  --accent-rgb: 92, 200, 232;
}

.app-index {
  display: none;
}

.app-icon {
  position: relative;
  z-index: 1;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 17px;
  box-shadow: inset 0 0 28px rgba(var(--accent-rgb), 0.06);
}

.app-icon svg,
.auth-mark svg {
  width: 29px;
  height: 29px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.app-content strong {
  color: var(--white);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-content span {
  max-width: 360px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.app-link-label {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 24px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.app-link-label span {
  display: inline-block;
  margin-left: 7px;
  transition: transform 180ms ease;
}

.app-card:hover .app-link-label span {
  transform: translateX(4px);
}

footer {
  margin-top: auto;
  padding-top: 48px;
  color: rgba(135, 152, 186, 0.55);
  font-size: 0.8rem;
}

footer p {
  margin: 0;
}

.motd-menu,
.account-menu {
  position: relative;
}

.motd-panel,
.account-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(370px, calc(100vw - 28px));
  padding: 24px;
  color: var(--text);
  background: rgba(5, 11, 24, 0.99);
  border: 1px solid rgba(99, 127, 180, 0.35);
  border-top: 2px solid var(--blue);
  border-radius: 16px;
  box-shadow: 0 28px 75px rgba(0, 2, 9, 0.7);
}

.motd-panel {
  border-top-color: var(--gold);
}

.account-title {
  margin: 0 0 20px;
  color: var(--white);
  font-size: 1.08rem;
  font-weight: 700;
}

.account-form {
  display: grid;
  gap: 15px;
}

.field {
  display: grid;
  gap: 9px;
}

.field span {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px;
  color: var(--white);
  background: rgba(2, 6, 15, 0.72);
  border: 1px solid rgba(111, 135, 181, 0.32);
  border-radius: 10px;
}

.field textarea {
  min-height: 118px;
  line-height: 1.5;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 3px solid rgba(67, 140, 255, 0.2);
  border-color: var(--blue);
}

.field-help {
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.primary-button {
  min-height: 52px;
  margin-top: 5px;
  padding: 13px 20px;
  color: #061027;
  font-weight: 700;
  background: linear-gradient(95deg, #4c91ff, #f1bc4f);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease;
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.account-submit {
  min-height: 49px;
}

.page-message,
.form-error {
  padding: 13px 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: 10px;
}

.page-message {
  max-width: 720px;
  margin: 30px 0 -18px;
}

.page-message--error,
.form-error {
  color: #ffe1da;
  background: rgba(134, 34, 25, 0.3);
  border: 1px solid rgba(255, 151, 137, 0.35);
}

.page-message--success {
  color: #dbf8e6;
  background: rgba(35, 112, 61, 0.27);
  border: 1px solid rgba(123, 216, 150, 0.34);
}

.motd {
  margin-top: 34px;
  padding: 19px 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  background:
    linear-gradient(105deg, rgba(255, 189, 50, 0.1), rgba(67, 140, 255, 0.06) 55%, rgba(22, 200, 191, 0.06)),
    rgba(7, 14, 29, 0.84);
  border: 1px solid rgba(255, 189, 50, 0.22);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.motd-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(255, 189, 50, 0.1);
  border: 1px solid rgba(255, 189, 50, 0.28);
  border-radius: 13px;
}

.motd-mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.motd-label {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.motd-text {
  margin: 0;
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
}

.motd ~ .app-grid {
  margin-top: 30px;
}

.form-error {
  position: relative;
  z-index: 1;
  margin: 22px 0 -10px;
}

.auth-page {
  width: min(100% - 32px, 510px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 38px 0;
  display: grid;
  place-items: center;
}

.auth-card {
  position: relative;
  width: 100%;
  padding: clamp(30px, 7vw, 46px);
  overflow: hidden;
  background: rgba(9, 18, 37, 0.94);
  border: 1px solid var(--line);
  border-radius: 23px;
  box-shadow: 0 30px 90px rgba(0, 2, 10, 0.55);
}

.auth-card::after {
  content: "";
  position: absolute;
  top: -180px;
  right: -170px;
  width: 350px;
  height: 350px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(67, 140, 255, 0.17), transparent 70%);
}

.auth-mark {
  width: 66px;
  height: 66px;
  margin-bottom: 32px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(67, 140, 255, 0.12);
  border: 1px solid rgba(67, 140, 255, 0.4);
  border-radius: 19px;
}

.auth-card .eyebrow {
  position: relative;
  z-index: 1;
}

.auth-card h1 {
  position: relative;
  z-index: 1;
  max-width: 400px;
  font-size: clamp(2.45rem, 10vw, 4rem);
  line-height: 0.98;
}

.auth-lead {
  position: relative;
  z-index: 1;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  margin-top: 31px;
}

.security-note {
  position: relative;
  z-index: 1;
  margin: 24px 0 0;
  color: rgba(135, 152, 186, 0.72);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

.organize-panel {
  position: relative;
  z-index: 20;
  margin-top: 34px;
  padding: clamp(22px, 4vw, 31px);
  background: rgba(5, 11, 24, 0.97);
  border: 1px solid rgba(99, 127, 180, 0.3);
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 2, 9, 0.52);
}

.organize-panel[hidden] {
  display: none;
}

.organize-panel:not([hidden]) + .app-grid {
  margin-top: 24px;
}

.organize-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.organize-heading .eyebrow {
  margin-bottom: 7px;
}

.organize-heading h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.panel-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.55rem;
  background: rgba(13, 26, 47, 0.58);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.organize-help {
  margin: 13px 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.order-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  list-style: none;
}

.order-item {
  min-height: 60px;
  padding: 9px 10px 9px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(116, 139, 184, 0.06);
  border: 1px solid rgba(116, 139, 184, 0.16);
  border-radius: 11px;
}

.order-item strong {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
}

.order-grip {
  width: 14px;
  overflow: hidden;
  color: rgba(135, 152, 186, 0.42);
  font-size: 0.68rem;
  letter-spacing: 1px;
  transform: rotate(90deg);
}

.order-controls {
  display: flex;
  gap: 5px;
}

.order-controls button {
  width: 37px;
  height: 37px;
  padding: 0;
  color: var(--blue);
  font-size: 1rem;
  background: rgba(67, 140, 255, 0.08);
  border: 1px solid rgba(67, 140, 255, 0.25);
  border-radius: 9px;
  cursor: pointer;
}

.order-controls button:hover:not(:disabled) {
  color: #061027;
  background: var(--blue);
}

.order-controls button:disabled {
  color: rgba(135, 152, 186, 0.22);
  background: transparent;
  border-color: rgba(116, 139, 184, 0.1);
  cursor: default;
}

.organize-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.organize-save,
.secondary-button {
  min-height: 48px;
  margin: 0;
  padding: 12px 18px;
}

.secondary-button {
  color: var(--text);
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.secondary-button:hover {
  background: rgba(116, 139, 184, 0.08);
  border-color: rgba(116, 139, 184, 0.42);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1020px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 28px, 580px);
    padding-top: 16px;
  }

  .intro-row {
    display: grid;
    gap: 22px;
  }

  .intro {
    grid-row: 2;
  }

  .account-actions {
    grid-row: 1;
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .logout-button,
  .organize-button,
  .motd-menu summary,
  .account-menu summary {
    min-height: 42px;
    padding: 10px 13px;
    font-size: 0.8rem;
  }

  h1 {
    font-size: clamp(2.65rem, 13vw, 3.65rem);
  }

  .lead {
    margin-top: 16px;
    line-height: 1.5;
  }

  .app-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 28px;
  }

  .app-card {
    min-height: 0;
    aspect-ratio: 1;
    padding: 8px;
    display: grid;
    place-items: center;
    border-radius: 16px;
  }

  .app-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .app-icon svg {
    width: 22px;
    height: 22px;
  }

  .app-content,
  .app-link-label {
    display: none;
  }

  .motd {
    margin-top: 26px;
    padding: 15px 16px;
    gap: 12px;
    border-radius: 15px;
  }

  .motd-mark {
    width: 39px;
    height: 39px;
    border-radius: 11px;
  }

  .motd-text {
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .motd ~ .app-grid {
    margin-top: 18px;
  }

  .order-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .page {
    padding-bottom: 26px;
  }

  .account-actions {
    gap: 7px;
  }

  .logout-button,
  .organize-button,
  .motd-menu summary,
  .account-menu summary {
    padding-inline: 11px;
    font-size: 0.75rem;
  }

  .eyebrow {
    margin-bottom: 13px;
  }

  .app-card {
    min-height: 0;
    padding: 7px;
  }

  .organize-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.app-card--vincia-tir {--accent:#f5c16e;--accent-rgb:245,193,110;}
.app-card--vincia-tir .app-icon {background:#09142a;color:#f5c16e;}
