:root {
  --bg: #eff3f6;
  --bg-alt: #e3ebf2;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --line: #d4dde8;
  --text: #17273b;
  --muted: #5f6d80;
  --primary: #0f7a69;
  --primary-dark: #0b5c50;
  --accent: #d97706;
  --danger: #b63e3e;
  --success: #2d8257;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 12px 32px rgba(23, 39, 59, 0.08);
  --font-main: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
  --font-title: 'Segoe UI', 'Gill Sans MT', 'Trebuchet MS', sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top right, #d3e3ef 0, var(--bg) 38%, #f3f7fa 100%);
  color: var(--text);
  font-family: var(--font-main);
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-title);
  margin: 0 0 0.6rem;
}

p {
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button,
input[type='submit'] {
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover,
.button:hover,
input[type='submit']:hover {
  background: var(--primary-dark);
}

button:active,
.button:active {
  transform: translateY(1px);
}

button.ghost,
.button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

button.warn {
  background: var(--accent);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #ffb249;
  outline-offset: 2px;
}

main {
  width: min(1160px, 92%);
  margin: 1.2rem auto 3.2rem;
}

.site-header {
  width: min(1160px, 92%);
  margin: 0.9rem auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-family: var(--font-title);
  font-size: 1.2rem;
}

.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  font-size: 0.87rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0, #39ac96 100%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.parody-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  text-align: center;
  background: #fff8d8;
  border-bottom: 1px solid #f1de94;
  color: #6f5200;
  padding: 0.45rem 1rem;
  font-size: 0.92rem;
}

.parody-banner p {
  margin: 0;
}

.page-footer {
  width: min(1160px, 92%);
  margin: 1.8rem auto 2.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.91rem;
}

.parody-footer-text {
  margin: 0;
  font-weight: 800;
  color: #6a5000;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(23, 39, 59, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  background: #daf2ee;
  color: #0d5f53;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 1rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.05;
}

.cta-line {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.kpi-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 0.7rem;
}

.kpi strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.section-title {
  margin: 1.8rem 0 0.9rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.testimonial {
  position: relative;
  overflow: hidden;
}

.testimonial::after {
  content: '"';
  position: absolute;
  right: 10px;
  top: -5px;
  color: #c6d9e8;
  font-size: 3rem;
  font-family: Georgia, serif;
}

.cookies-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(460px, calc(100% - 2rem));
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 1rem;
  z-index: 40;
}

.cookie-list {
  margin: 0.7rem 0;
  max-height: 225px;
  overflow: auto;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: grid;
  gap: 0.4rem;
  background: #fbfdff;
}

.cookie-item {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  font-size: 0.93rem;
}

.choices,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-line,
.radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.wizard-wrap {
  display: grid;
  gap: 0.8rem;
}

.wizard-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.progress-track,
.strength-track,
.loader-track {
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: #dfe6ef;
}

.progress-track {
  height: 12px;
}

.progress-fill,
.strength-fill,
.loader-fill {
  height: 100%;
  width: 0;
  transition: width 0.32s ease;
}

.progress-fill,
.loader-fill {
  background: linear-gradient(90deg, #0f7a69 0, #4ec2ac 100%);
}

.step {
  display: none;
}

.step.active {
  display: block;
  animation: fadeIn 0.28s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field {
  margin-bottom: 0.9rem;
}

.field label,
.label {
  font-weight: 800;
  display: block;
  margin-bottom: 0.33rem;
}

.input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.75rem;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 125px;
  resize: vertical;
}

.input-row {
  display: flex;
  gap: 0.55rem;
}

.input-row .input {
  flex: 1;
}

.captcha-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.captcha-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7fbfe;
  color: var(--text);
  text-align: left;
  min-height: 78px;
  font-weight: 700;
  padding: 0.55rem;
}

.captcha-btn.active {
  background: #daf2ee;
  border-color: #0f7a69;
}

.rules {
  list-style: none;
  margin: 0.65rem 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.rules li {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdff;
  padding: 0.45rem 0.58rem;
  font-size: 0.93rem;
}

.rules li.ok {
  border-color: #badfcc;
  background: #edf9f0;
}

.strength-track {
  height: 10px;
}

.strength-label {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdff;
  padding: 0.75rem;
}

.plan-card.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.cgu-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdff;
  max-height: 220px;
  overflow: auto;
  padding: 0.72rem;
}

.cgu-scroll p {
  margin: 0 0 0.62rem;
}

.box-info,
.box-error,
.box-success,
.box-warning {
  border: 1px solid;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.72rem;
  font-size: 0.94rem;
  margin: 0.65rem 0;
}

.box-info {
  background: #eef6ff;
  border-color: #c3d8f1;
  color: #1a4972;
}

.box-error {
  background: #fff3f3;
  border-color: #efc4c4;
  color: #7b2727;
}

.box-success {
  background: #edf9f0;
  border-color: #badfcc;
  color: #135534;
}

.box-warning {
  background: #fff7e5;
  border-color: #f0dbac;
  color: #7b5500;
}

.wizard-nav {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.loader-track {
  height: 15px;
}

.tiny-link {
  font-size: 0.84rem;
  color: #6a7788;
}

.wobble {
  animation: wobble 0.62s ease;
}

@keyframes wobble {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(280px, 360px) minmax(0, 1fr);
  gap: 0.9rem;
}

.sidebar,
.mail-list,
.mail-read {
  background: var(--surface);
  border: 1px solid rgba(23, 39, 59, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.sidebar,
.mail-read {
  padding: 0.8rem;
}

.menu-list {
  display: grid;
  gap: 0.35rem;
}

.menu-btn {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
}

.menu-btn:hover,
.menu-btn.active {
  background: #eef6fb;
  border-color: var(--line);
}

.mail-badge {
  display: inline-block;
  margin-left: 0.45rem;
  min-width: 24px;
  text-align: center;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid #c0d6eb;
  background: #e8f2fc;
  color: #23486e;
  padding: 0.1rem 0.35rem;
}

.topbar {
  margin-bottom: 0.8rem;
  display: flex;
  gap: 0.5rem;
}

.topbar .input {
  flex: 1;
}

.mail-list {
  overflow: hidden;
  min-height: 620px;
}

.mail-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mail-item {
  width: 100%;
  text-align: left;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  padding: 0.75rem;
}

.mail-item:hover,
.mail-item.active {
  background: #edf5fb;
}

.mail-item.unread .mail-subject {
  font-weight: 900;
}

.mail-item.swallow {
  animation: swallow 420ms ease forwards;
}

@keyframes swallow {
  to {
    opacity: 0;
    transform: scale(0.84) translateX(22px);
  }
}

.mail-subject {
  display: block;
  font-weight: 800;
}

.mail-preview,
.mail-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.mail-read {
  min-height: 620px;
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.6rem 0 0.8rem;
}

.mail-body {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.guilt {
  background: #fff6e9;
  border: 1px solid #f0dab1;
  border-radius: 9px;
  font-size: 0.86rem;
  color: #845900;
  padding: 0.45rem 0.55rem;
}

.skeleton {
  background: linear-gradient(90deg, #edf3f9 25%, #f7fbff 38%, #edf3f9 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.skeleton-line {
  height: 12px;
  margin-bottom: 0.5rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 25, 0.48);
  display: grid;
  place-items: center;
  z-index: 70;
  padding: 1rem;
}

.modal-panel {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: start;
}

.autocomplete-list {
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  max-height: 120px;
  overflow: auto;
}

.autocomplete-item {
  width: 100%;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  color: var(--text);
  padding: 0.5rem;
}

.autocomplete-item:last-child {
  border-bottom: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 0.65rem 0;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  background: #17273b;
  color: #fff;
  font-size: 0.78rem;
  white-space: nowrap;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  z-index: 90;
}

.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: min(360px, calc(100% - 2rem));
  z-index: 100;
  display: grid;
  gap: 0.48rem;
}

.toast {
  border-radius: var(--radius-sm);
  border: 1px solid;
  box-shadow: var(--shadow);
  padding: 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.5rem;
  animation: toastIn 0.24s ease;
}

.toast button {
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  font-weight: 900;
}

.toast-info {
  background: #edf6ff;
  border-color: #c3d8f1;
  color: #1a4972;
}

.toast-warning {
  background: #fff7e7;
  border-color: #eed9aa;
  color: #7d5600;
}

.toast-success {
  background: #edf9f0;
  border-color: #badfcc;
  color: #145835;
}

.toast-error {
  background: #fff3f3;
  border-color: #efc4c4;
  color: #7b2727;
}

.toast-out {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cat-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}

.cat-spawn {
  position: fixed;
  left: 0;
  top: 0;
  will-change: transform, opacity;
}

.cat-spawn img,
.cat-fallback {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(17, 31, 44, 0.25);
}

.cat-fallback {
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: #fff2d8;
  border: 1px solid #efddb1;
}

.swoosh-line {
  position: fixed;
  left: -20px;
  top: 50%;
  width: 110px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 150, 126, 0), rgba(34, 150, 126, 0.8));
  z-index: 110;
  pointer-events: none;
  animation: swoosh 1.15s ease forwards;
}

@keyframes swoosh {
  to {
    transform: translateX(calc(100vw + 180px));
    opacity: 0;
  }
}

.jumpy {
  transform: translate(2px, -2px);
}

.nuisance-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(11, 17, 28, 0.62);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.nuisance-panel {
  width: min(520px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid #f1d8a6;
  box-shadow: 0 14px 34px rgba(10, 18, 28, 0.4);
  background: #fff7e5;
  color: #2f2100;
  padding: 1rem;
}

.nuisance-countdown {
  font-size: 0.92rem;
  color: #6f4c00;
}

.nuisance-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #ecd9b1;
  margin: 0.6rem 0;
}

.nuisance-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #d97706, #efb15a);
  transition: width 0.15s linear;
}

.nuisance-fakebar {
  position: fixed;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 205;
  background: #122235;
  color: #fff;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(10, 18, 28, 0.3);
  padding: 0.52rem 0.7rem;
  overflow: hidden;
}

.nuisance-fakebar .nuisance-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(41, 184, 154, 0.2), rgba(41, 184, 154, 0.5));
  animation: nuisanceFill 2.6s linear forwards;
}

@keyframes nuisanceFill {
  to {
    width: 100%;
  }
}

.nuisance-maintenance {
  position: fixed;
  left: 1rem;
  right: 1rem;
  top: 56px;
  z-index: 206;
  border: 1px solid #f3d7a0;
  background: #fff4de;
  color: #3e2a00;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(10, 18, 28, 0.22);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
}

.nuisance-maintenance strong {
  display: block;
}

.nuisance-maintenance span {
  font-size: 0.88rem;
}

body.nuisance-shake {
  animation: nuisanceShake 0.15s linear infinite;
}

@keyframes nuisanceShake {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1px, 1px);
  }
  50% {
    transform: translate(1px, -1px);
  }
  75% {
    transform: translate(-1px, 0);
  }
  100% {
    transform: translate(0, 0);
  }
}

.nuisance-runaway {
  cursor: not-allowed !important;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

.avatar-btn {
  font-size: 2.5rem;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.avatar-btn.active {
  border-color: var(--accent);
  background: rgba(41, 184, 154, 0.15);
  transform: scale(1.15);
}

.notification-list {
  margin: 1rem 0;
}

.jumpy {
  animation: jumpAway 0.15s ease;
}

@keyframes jumpAway {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes crazySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.chaos-spin {
  animation: crazySpin 0.5s linear infinite;
}

@keyframes flash {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.3; }
}

.flash {
  animation: flash 0.2s ease 3;
}

@media (max-width: 1020px) {
  .hero-grid,
  .grid-3,
  .plan-grid {
    grid-template-columns: 1fr;
  }

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

  .app-shell {
    grid-template-columns: 1fr;
  }

  .mail-list,
  .mail-read {
    min-height: auto;
  }

  .wizard-head {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: start;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button,
  .header-actions a {
    flex: 1;
    text-align: center;
  }

  .input-row {
    flex-direction: column;
  }

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