/* ============================================================
 * Automation Pro / スマホ自動化Pro — content pages theme
 *
 * Stand-alone CSS for the static legal pages (privacy policy /
 * refund policy). Mirrors the Android app's look: clean surfaces,
 * generous rounding, and the brand indigo accent (#5A46F0).
 * Colors come from the app's res/values/colors.xml (light) and
 * res/values-night/colors.xml (dark). Light by default; the dark
 * variant kicks in via prefers-color-scheme so it tracks the OS
 * just like the app's "Auto" theme.
 * ============================================================ */

:root {
  /* Brand (values/colors.xml: accent_cyan / rich_on_accent_container / c_violet) */
  --ab-brand: #5A46F0;          /* indigo — primary accent */
  --ab-brand-deep: #4A36E2;     /* pressed / gradient end */
  --ab-brand-bright: #7556FF;   /* hover / highlight */
  --ab-brand-tint: rgba(90, 70, 240, 0.10);

  /* Light surfaces (bg / hero_bg / settings_row_bg / rich_choice_bg / lineColor) */
  --ab-bg: #F4F4FA;             /* page background */
  --ab-bg-grad-1: #EEEBFF;
  --ab-bg-grad-2: #F4F4FA;
  --ab-surface: #FFFFFF;        /* cards */
  --ab-surface-2: #F2F2F8;      /* nested / faq closed */
  --ab-border: #E9E9F2;
  --ab-border-strong: #DADAE7;

  /* Text (textColor; paragraph is textColor2 #60607A a little darker for long
     reading; meta sits between textColor2 and text3 so it keeps contrast) */
  --ab-text: #15152B;           /* headings / body strong */
  --ab-text-soft: #4E4E68;      /* paragraph */
  --ab-text-muted: #7A7A94;     /* meta */

  /* Shape */
  --ab-radius-lg: 22px;
  --ab-radius-md: 16px;
  --ab-radius-sm: 12px;
  --ab-radius-pill: 999px;

  /* Elevation (card_shadow #1418184A) */
  --ab-shadow-card: 0 1px 2px rgba(24, 24, 74, 0.04),
                    0 12px 32px -16px rgba(24, 24, 74, 0.22);
  --ab-shadow-glow: 0 8px 22px -8px rgba(90, 70, 240, 0.45);
}

/* Dark (values-night/colors.xml: bg / hero_bg / settings_row_bg / surface2 /
   lineColor / textColor / textColor2 / accent_cyan) */
@media (prefers-color-scheme: dark) {
  :root {
    --ab-bg: #0D0D17;
    --ab-bg-grad-1: #211C48;
    --ab-bg-grad-2: #0D0D17;
    --ab-surface: #171726;
    --ab-surface-2: #212134;
    --ab-border: #262640;
    --ab-border-strong: #34344D;

    --ab-text: #F1F1F8;
    --ab-text-soft: #B4B4CC;
    --ab-text-muted: #7E7E9C;

    --ab-brand: #8C7CFF;
    --ab-brand-deep: #6552F5;
    --ab-brand-bright: #A99DFF;
    --ab-brand-tint: rgba(140, 124, 255, 0.16);

    --ab-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.30),
                      0 16px 40px -20px rgba(0, 0, 0, 0.70);
    --ab-shadow-glow: 0 8px 22px -8px rgba(140, 124, 255, 0.50);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, var(--ab-bg-grad-1), transparent 70%),
    var(--ab-bg-grad-2);
  background-attachment: fixed;
  color: var(--ab-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Long English words / URLs must not blow out narrow phone widths. */
.ab-card p,
.ab-card li,
.ab-faq-answer,
.ab-faq-item summary {
  overflow-wrap: anywhere;
  word-break: break-word;
}

a {
  color: var(--ab-brand);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--ab-brand-bright); }

::selection {
  background: var(--ab-brand-tint);
  color: var(--ab-text);
}

/* ============================================================
 * Page scaffold
 * ============================================================ */
.ab-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Top bar ----- */
.ab-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--ab-surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--ab-border);
}

.ab-topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ab-back {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ab-brand-tint);
  border: 1px solid var(--ab-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ab-brand);
  font-size: 1.2rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ab-back:hover {
  background: var(--ab-brand);
  border-color: var(--ab-brand);
  color: #fff;
}

.ab-topbar h1 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ab-text);
  /* Long one-word titles (de "Rückerstattungsrichtlinie", ru, fi …) must
     shrink and wrap instead of pushing the language switcher off-screen. */
  min-width: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
  line-height: 1.3;
}

.ab-brandmark {
  flex: none;
  display: inline-flex;
  align-items: center;
}
.ab-brandmark img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
}

/* ----- Language switcher ----- */
.ab-lang-switch {
  flex: none;
  margin-inline-start: auto;
  display: flex;
  align-items: center;
}
.ab-lang-switch select {
  background-color: var(--ab-surface);
  border: 1px solid var(--ab-border-strong);
  color: var(--ab-text);
  padding-block: 8px;
  padding-inline: 12px 30px;
  border-radius: var(--ab-radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A46F0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
[dir="rtl"] .ab-lang-switch select { background-position: left 9px center; }
@media (prefers-color-scheme: dark) {
  .ab-lang-switch select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C7CFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  }
}
.ab-lang-switch select:focus {
  outline: none;
  border-color: var(--ab-brand);
  box-shadow: 0 0 0 3px var(--ab-brand-tint);
}

/* ----- Content ----- */
.ab-content {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px 24px;
}

.ab-card {
  background: var(--ab-surface);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow-card);
  padding: 32px 36px;
  margin-bottom: 22px;
}

.ab-card > :first-child { margin-top: 0; }
.ab-card > :last-child { margin-bottom: 0; }

.ab-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 32px 0 14px;
  color: var(--ab-text);
  padding-inline-start: 14px;
  border-inline-start: 4px solid var(--ab-brand);
  line-height: 1.4;
}
.ab-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--ab-text);
}

.ab-card p,
.ab-card li {
  color: var(--ab-text-soft);
  font-size: 0.97rem;
  line-height: 1.8;
}
.ab-card strong,
.ab-card b { color: var(--ab-text); }

.ab-card ol,
.ab-card ul {
  padding-inline-start: 1.4rem;
  margin: 12px 0;
}
.ab-card li { margin-bottom: 6px; }

.ab-card ul li::marker { color: var(--ab-brand); }

.ab-effective {
  color: var(--ab-text-muted);
  font-size: 0.85rem;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--ab-border);
}

/* Lead paragraph in the FAQ intro card */
.ab-intro {
  margin: 0;
  color: var(--ab-text-soft);
}

/* ============================================================
 * FAQ accordion
 * ============================================================ */
.ab-faq-item {
  background: var(--ab-surface);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--ab-shadow-card);
  transition: border-color 0.2s ease;
}
.ab-faq-item[open] {
  border-color: var(--ab-brand);
}
.ab-faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  color: var(--ab-text);
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ab-faq-item summary::-webkit-details-marker { display: none; }
.ab-faq-item summary::after {
  content: "";
  flex: none;
  margin-inline-start: auto;
  width: 22px;
  height: 22px;
  background: var(--ab-brand);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5v14M5 12h14' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5v14M5 12h14' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / contain no-repeat;
  transition: transform 0.25s ease;
}
.ab-faq-item[open] summary::after {
  transform: rotate(135deg);
}
.ab-faq-item summary:hover { color: var(--ab-brand); }

.ab-faq-answer {
  padding: 0 22px 20px;
  color: var(--ab-text-soft);
  font-size: 0.95rem;
  line-height: 1.8;
}
.ab-faq-answer > :first-child { margin-top: 0; }
.ab-faq-answer ol,
.ab-faq-answer ul { padding-inline-start: 1.3rem; }
.ab-faq-answer li { margin-bottom: 6px; }
.ab-faq-answer strong { color: var(--ab-text); }

/* ============================================================
 * Footer nav (also embeddable on the top page)
 * ============================================================ */
.ab-footer-nav {
  background: var(--ab-surface);
  border-top: 1px solid var(--ab-border);
  padding: 32px 24px;
  margin-top: 8px;
}
.ab-footer-nav-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.ab-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
}
.ab-footer-links a {
  color: var(--ab-text-soft);
  font-size: 0.92rem;
  font-weight: 500;
}
.ab-footer-links a:hover { color: var(--ab-brand); }
.ab-footer-copy {
  color: var(--ab-text-muted);
  font-size: 0.82rem;
  margin: 0;
}
.ab-footer-copy a { color: var(--ab-text-muted); }
.ab-footer-copy a:hover { color: var(--ab-brand); }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 600px) {
  .ab-content { padding: 22px 14px 16px; }
  .ab-card { padding: 22px 18px; border-radius: var(--ab-radius-md); }
  .ab-topbar-inner { padding: 10px 14px; gap: 10px; }
  .ab-topbar h1 { font-size: 1.05rem; }
  .ab-card h2 { font-size: 1.18rem; }
  .ab-card h3 { font-size: 1rem; }
  .ab-lang-switch select { font-size: 0.8rem; padding-block: 7px; padding-inline: 10px 26px; }
  .ab-faq-item summary { padding: 15px 16px; font-size: 0.96rem; }
  .ab-faq-answer { padding: 0 16px 16px; font-size: 0.92rem; }
}
