/* AUN Bizznes legal pages — palette mirrors lib/core/constants/app_colors.dart */

:root {
  color-scheme: light;
  --primary: #d97d55;
  --primary-dark: #b86442;
  --primary-light: #e59a7a;
  --primary-container: #f3d6c8;
  --accent: #b8c4a9;
  --accent-dark: #7e8f70;
  --accent-light: #d3ddc8;
  --surface: #fffbf9;
  --background: #f5f3ef;
  --card: #ffffff;
  --text-primary: #1c3035;
  --text-muted: #6b7280;
  --text-soft: #4b5563;
  --border: #ede7df;
  --border-strong: #cdd5e0;
  --hero-top: #162d5a;
  --hero-mid: #0f2042;
  --hero-dark: #091530;
  --hero-ink: #fff5ee;
  --hero-ink-soft: #f0e6de;
  --ok: #2e7d32;
  --notice-bg: #f3f8fc;
  --notice-border: #c5d5e8;
  --glass-top: rgba(255, 251, 249, 0.92);
  --glass-bottom: rgba(255, 251, 249, 0.78);
  --glass-border: rgba(237, 231, 223, 0.9);
  --shadow: 0 18px 36px rgba(15, 32, 66, 0.08);
  --toc-hover: #f3d6c8;
  --max-width: 1080px;
  --content-width: 72ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--background);
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 0% 0%, rgba(217, 125, 85, 0.12), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(184, 196, 169, 0.14), transparent 36%),
    linear-gradient(180deg, var(--surface), var(--background));
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a,
button,
.toc-toggle,
.faq-question,
.contact-btn,
.card-link {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus,
button:focus,
.toc-toggle:focus,
.faq-question:focus,
.contact-btn:focus {
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
}

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

@media (hover: hover) and (pointer: fine) {
  a:hover {
    color: var(--primary);
  }
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 12px calc(56px + env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
}

@media (min-width: 640px) {
  .container {
    padding: 26px 20px 84px;
  }
}

/* Hero header */
.hero {
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-banner {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 52%, var(--primary-dark) 100%);
  color: var(--hero-ink);
  padding: 48px 20px 24px;
  text-align: center;
}

.wordmark {
  display: block;
  width: min(168px, 62vw);
  height: auto;
  margin: 0 auto 14px;
}

.wordmark-fallback {
  display: none;
  margin: 0 0 14px;
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  font-weight: 300;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--hero-ink);
}

.wordmark-fallback.is-visible {
  display: block;
}

.hero-body {
  padding: 22px 20px 24px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

@media (max-width: 639px) {
  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-body {
    padding: 18px 14px 20px;
  }

  .hero-banner {
    padding: 42px 14px 20px;
  }

  .pill,
  .stamp {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--primary-container);
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 11px;
  background: rgba(243, 214, 200, 0.45);
}

.stamp {
  color: var(--ok);
  font-size: 0.86rem;
  font-weight: 600;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  line-height: 1.15;
  color: var(--text-primary);
}

.hero-copy {
  margin: 0;
  color: var(--text-muted);
  max-width: var(--content-width);
}

.meta {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.meta strong {
  color: var(--text-primary);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  min-width: 0;
}

.doc {
  min-width: 0;
}

@media (min-width: 920px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
  }
}

.toc {
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  padding: 14px;
  box-shadow: 0 14px 28px rgba(15, 32, 66, 0.06);
}

@media (min-width: 920px) {
  .toc {
    position: sticky;
    top: 14px;
    align-self: start;
  }
}

.toc-panel {
  border: none;
  margin: 0;
  padding: 0;
}

.toc-toggle {
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.93rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.toc-panel.open .toc-toggle {
  margin-bottom: 10px;
}

.toc-toggle::after {
  content: "+";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.28s ease, color 0.2s ease;
}

.toc-panel.open .toc-toggle::after {
  content: "−";
  transform: rotate(180deg);
}

.toc-links-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s ease;
}

.toc-panel.open .toc-links-wrap {
  grid-template-rows: 1fr;
}

.toc-links-wrap > * {
  overflow: hidden;
  min-height: 0;
}

.toc-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.toc-panel.open .toc-links {
  opacity: 1;
  transition: opacity 0.26s ease 0.08s;
}

.toc-links a {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  border-radius: 10px;
  padding: 6px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toc-links a:active,
.toc-toggle:active,
.faq-question:active {
  background-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .toc-links a:hover,
  .toc-links a:focus-visible {
    background: var(--toc-hover);
    color: var(--primary-dark);
    outline: none;
  }
}

@media (min-width: 920px) {
  .toc-toggle {
    cursor: default;
    pointer-events: none;
  }

  .toc-toggle::after {
    display: none;
  }

  .toc-links-wrap {
    grid-template-rows: 1fr;
  }

  .toc-links {
    opacity: 1;
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toc-links-wrap,
  .toc-links,
  .toc-toggle::after {
    transition: none;
  }
}

.doc section[id] {
  scroll-margin-top: 8px;
}

.doc section {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px 12px;
  margin-bottom: 12px;
  box-shadow: 0 14px 26px rgba(15, 32, 66, 0.05);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (min-width: 640px) {
  .doc section {
    padding: 20px 22px;
  }
}

.doc h2 {
  margin: 0 0 9px;
  font-size: clamp(1rem, 4.2vw, 1.16rem);
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.doc h3 {
  margin: 16px 0 8px;
  font-size: clamp(0.95rem, 3.8vw, 1.02rem);
  line-height: 1.4;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

p,
li {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

li {
  margin-bottom: 6px;
}

.notice {
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: var(--notice-bg);
  border-top: 1px solid var(--notice-border);
  border-right: 1px solid var(--notice-border);
  border-bottom: 1px solid var(--notice-border);
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.table-wrap {
  margin: 12px 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.table-wrap table {
  margin: 0;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.85rem;
}

@media (min-width: 640px) {
  table {
    font-size: 0.9rem;
  }
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  background: var(--background);
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 639px) {
  th,
  td {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  th {
    white-space: normal;
  }
}

.site-footer {
  margin-top: 10px;
  padding-top: 4px;
  font-size: 0.88rem;
  color: var(--text-soft);
  text-align: center;
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer a {
  color: var(--primary-dark);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer a:hover {
    text-decoration: underline;
  }
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.legal-nav a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

@media (hover: hover) and (pointer: fine) {
  .legal-nav a:hover,
  .legal-nav a:focus-visible {
    text-decoration: underline;
    outline: none;
  }
}

/* Support — FAQ accordion */
.faq-list {
  margin-top: 4px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--card);
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 16px 48px 16px 18px;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  font-family: inherit;
  line-height: 1.45;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.28s ease;
}

.faq-item.open .faq-question {
  background: var(--primary-container);
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.35rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1;
  transition: transform 0.28s ease, color 0.2s ease;
}

.faq-item.open .faq-question::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 18px;
  font-size: 0.95rem;
  transition: grid-template-rows 0.32s ease, padding 0.32s ease;
}

.faq-item.open .faq-answer {
  grid-template-rows: 1fr;
  padding: 0 18px 16px;
}

.faq-answer > * {
  overflow: hidden;
  min-height: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.faq-item.open .faq-answer > * {
  opacity: 1;
  transition: opacity 0.26s ease 0.08s;
}

@media (prefers-reduced-motion: reduce) {
  .faq-answer,
  .faq-answer > *,
  .faq-question::after {
    transition: none;
  }
}

.contact-panel {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 22px 20px;
  margin-top: 8px;
  box-shadow: 0 12px 24px rgba(15, 32, 66, 0.05);
}

.contact-panel h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  color: var(--text-primary);
}

.contact-btn {
  display: inline-block;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--hero-mid), var(--hero-dark));
  color: var(--hero-ink);
  padding: 13px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  box-shadow: 0 8px 18px rgba(15, 32, 66, 0.18);
}

.contact-btn:active {
  transform: none;
  box-shadow: 0 8px 18px rgba(15, 32, 66, 0.18);
  color: var(--hero-ink);
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .contact-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .contact-btn:hover,
  .contact-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15, 32, 66, 0.22);
    outline: none;
  }
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}

@media (min-width: 560px) {
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.info-card .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-card .value {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
}

.link-row a {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--primary-container);
  padding-bottom: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .link-row a:hover {
    border-bottom-color: var(--primary);
  }
}

/* Landing cards */
.landing-hero .hero-banner {
  padding: 60px 20px 36px;
}

.landing-hero .tagline {
  margin: 0;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  line-height: 1.55;
  color: var(--hero-ink-soft);
  max-width: 34rem;
  margin-inline: auto;
}

.landing-hero .byline {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: rgba(255, 245, 238, 0.55);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

@media (min-width: 560px) {
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
  }
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: 0 8px 20px rgba(15, 32, 66, 0.05);
}

.card-link:active {
  transform: none;
  border-color: var(--border);
  box-shadow: 0 8px 20px rgba(15, 32, 66, 0.05);
}

@media (hover: hover) and (pointer: fine) {
  .card-link {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .card-link:hover,
  .card-link:focus-visible {
    transform: translateY(-2px);
    border-color: var(--primary-container);
    box-shadow: 0 14px 28px rgba(15, 32, 66, 0.1);
    outline: none;
  }
}

.card-link h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.card-link p {
  margin: 0;
  font-size: 0.94rem;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-container);
  color: var(--primary-dark);
  font-size: 1.25rem;
  margin-bottom: 14px;
}

@media print {
  body {
    background: #fff;
  }

  .toc {
    display: none;
  }

  .hero,
  .doc section,
  .card-link {
    box-shadow: none;
    border-color: #ddd;
  }
}

.deletion-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.deletion-form label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.deletion-form input,
.deletion-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font: inherit;
  color: var(--text-primary);
  background: var(--card);
}

.deletion-form textarea {
  min-height: 88px;
  resize: vertical;
}

.deletion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn-primary,
.btn-danger,
.btn-secondary {
  border: none;
  border-radius: 12px;
  padding: 13px 22px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--hero-mid), var(--hero-dark));
  color: var(--hero-ink);
}

.btn-danger {
  background: linear-gradient(135deg, #b33a3a, #8f2b2b);
  color: #fff;
}

.btn-secondary {
  background: var(--card);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-primary:disabled,
.btn-danger:disabled,
.btn-secondary:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.btn-loading {
  position: relative;
  padding-left: 40px;
}

.btn-loading::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: aun-btn-spin 0.7s linear infinite;
}

@keyframes aun-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.deletion-status {
  margin-top: 12px;
}

.deletion-error {
  color: #b33a3a;
  margin-top: 10px;
  font-size: 0.92rem;
}

.deletion-hidden {
  display: none !important;
}

.deletion-copy-muted {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

#delete-request,
#step-auth-verified,
#step-auth-confirm {
  scroll-margin-top: 24px;
}

.deletion-email-display {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 8px 0 16px;
  word-break: break-word;
}

.deletion-verified-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #2e7d32;
  font-weight: 600;
}

.deletion-verified-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #2e7d32;
  color: #fff;
  font-size: 0.85rem;
}

.otp-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.otp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 21, 48, 0.55);
  pointer-events: none;
}

.otp-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 20px 20px;
  box-shadow: var(--shadow);
}

.otp-modal-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 8px;
}

.otp-box {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  border: 1px solid #c5d0e3;
  border-radius: 12px;
  background: #fff;
  color: #0f2042;
  color-scheme: light;
  caret-color: #0f2042;
}

.otp-box:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
  background: #fff;
}

.otp-autofill-capture {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  color-scheme: light;
  background: #fff;
  color: #0f2042;
}

.otp-modal-form {
  color-scheme: light;
}

.otp-modal-actions {
  margin-top: 16px;
  justify-content: flex-end;
}
