/* ============================================================
 * Mission Alarm Clock Pro — content pages theme
 *
 * Stand-alone CSS for the legal pages (privacy policy / refund
 * policy). Mirrors the Android app's look: the brand violet
 * (#5B45F5 fill / #4A35E0 text) with the sunrise orange (#FF7A3D)
 * as the second color, soft lavender surfaces and generous rounding.
 * Light by default; a dark "night sky" variant kicks in via
 * prefers-color-scheme so it tracks the OS like the app does.
 * Layout uses logical properties so ar / he (dir="rtl") mirror.
 * ============================================================ */

:root {
  /* Brand */
  --ab-brand: #5B45F5;          /* violet — accent fill (buttons, bars) */
  --ab-brand-deep: #4A35E0;     /* violet — accent text */
  --ab-brand-bright: #7A68FF;   /* hover / highlight */
  --ab-brand-tint: rgba(91, 69, 245, 0.10);
  --ab-sun: #FF7A3D;            /* sunrise — second color */
  --ab-link: #4A35E0;
  --ab-link-hover: #5B45F5;

  /* Light surfaces */
  --ab-bg: #F5F4FA;             /* page background */
  --ab-bg-grad-1: #E6E1FF;      /* violet glow at the top */
  --ab-bg-grad-sun: rgba(255, 122, 61, 0.12);
  --ab-bg-grad-2: #F5F4FA;
  --ab-surface: #FFFFFF;        /* cards */
  --ab-surface-2: #F8F7FC;
  --ab-border: #EAE7F3;
  --ab-border-strong: #D8D3EA;

  /* Text */
  --ab-text: #17152E;           /* headings / strong */
  --ab-text-soft: #3E3A58;      /* paragraph */
  --ab-text-muted: #67637F;     /* meta */

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

  /* Elevation */
  --ab-shadow-card: 0 1px 2px rgba(23, 21, 46, 0.04),
                    0 12px 32px -16px rgba(58, 40, 170, 0.22);
  --ab-shadow-glow: 0 8px 22px -8px rgba(91, 69, 245, 0.45);

  --ab-select-arrow: 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='%235B45F5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

@media (prefers-color-scheme: dark) {
  :root {
    --ab-bg: #0C0B1A;
    --ab-bg-grad-1: #231C52;
    --ab-bg-grad-sun: rgba(255, 122, 61, 0.10);
    --ab-bg-grad-2: #0C0B1A;
    --ab-surface: #16152B;
    --ab-surface-2: #121126;
    --ab-border: rgba(255, 255, 255, 0.09);
    --ab-border-strong: rgba(255, 255, 255, 0.16);

    --ab-text: #F3F1FF;
    --ab-text-soft: #D0CCE9;
    --ab-text-muted: #A7A3C6;

    --ab-brand: #8E7DFF;
    --ab-brand-deep: #B2A6FF;
    --ab-brand-bright: #C9C0FF;
    --ab-brand-tint: rgba(178, 166, 255, 0.16);
    --ab-link: #B2A6FF;
    --ab-link-hover: #D2CAFF;

    --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(142, 125, 255, 0.50);

    --ab-select-arrow: 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='%23B2A6FF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 85% -5%, var(--ab-bg-grad-sun), transparent 70%),
    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 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

::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);
}
/* Dawn line: violet night fading into the sunrise. */
.ab-topbar::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #5B45F5, #8E5BE8 55%, var(--ab-sun));
}

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

.ab-topbar h1 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ab-text);
  min-width: 0;
}

.ab-brandmark {
  flex: none;
  display: inline-flex;
  align-items: center;
}
.ab-brandmark img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 1px 3px rgba(23, 21, 46, 0.18);
}

/* ----- Language switcher ----- */
.ab-lang-switch {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  flex: none;
}
.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: var(--ab-select-arrow);
  background-repeat: no-repeat;
  background-position: right 9px center;
}
[dir="rtl"] .ab-lang-switch select { background-position: left 9px center; }
.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; }

/* App name label above the body (which app this policy is for). */
.ab-card .ab-appname {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 12px;
  border-radius: var(--ab-radius-pill);
  background: var(--ab-brand-tint);
  color: var(--ab-brand-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.ab-card h2 {
  position: relative;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 34px 0 14px;
  color: var(--ab-text);
  padding-inline-start: 16px;
  line-height: 1.4;
}
.ab-card h2::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--ab-brand), var(--ab-sun));
}
.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 { 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-card ol li::marker { color: var(--ab-brand-deep); font-weight: 700; }

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

/* ============================================================
 * Footer
 * ============================================================ */
.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-link-hover); }
.ab-footer-copy {
  color: var(--ab-text-muted);
  font-size: 0.82rem;
  margin: 0;
}

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 600px) {
  .ab-content { padding: 20px 16px 16px; }
  .ab-card { padding: 22px 18px; border-radius: var(--ab-radius-md); }
  .ab-topbar-inner { padding: 10px 16px; gap: 10px; }
  .ab-topbar h1 { font-size: 1.05rem; line-height: 1.35; text-wrap: balance; }
  .ab-card h2 { font-size: 1.18rem; }
  .ab-card h3 { font-size: 1rem; }
  /* The select is as wide as its longest option ("Bahasa Indonesia"); cap it so
     the page title keeps enough room and does not drop its last character. */
  .ab-lang-switch select {
    font-size: 0.8rem;
    padding-block: 7px;
    padding-inline: 10px 26px;
    max-width: 112px;
    text-overflow: ellipsis;
  }
}
