/* Bubba Academy Tools — Persian RTL design system.
   System fonts only: no external font service dependency. */

:root {
  --bg: #0b111c;
  --bg-elevated: #111a29;
  --surface: #16203100;
  --panel: #131d2e;
  --panel-2: #182437;
  --border: #26344b;
  --border-strong: #35486a;

  --text: #f3f6fb;
  --text-muted: #a9b8ce;
  --text-dim: #8095b1;

  --accent: #ff8329;
  --accent-hover: #ff9748;
  --accent-soft: rgba(255, 131, 41, 0.14);
  --accent-ink: #251103;

  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);

  /* Confirmation green — used for completed checklist items. Measured contrast
     on the dark navy surfaces: #4ade80 on --panel-2 is 8.95:1, and the tick
     (--confirm-ink on --confirm) is 9.52:1. Both clear WCAG AAA (7:1). */
  --confirm: #4ade80;
  --confirm-soft: rgba(74, 222, 128, 0.13);
  --confirm-ink: #05240f;
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --focus: 0 0 0 3px rgba(255, 131, 41, 0.45);

  --font: "Vazirmatn", "IRANSans", "Segoe UI", Tahoma, system-ui, -apple-system,
    "Noto Sans Arabic", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(255, 131, 41, 0.09), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  line-height: 1.5;
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  direction: ltr;
  unicode-bidi: embed;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.42em;
  font-size: 0.88em;
  white-space: nowrap;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px;
  z-index: 50;
}

.skip-link:focus {
  inset-inline-start: 1rem;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 28, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}

/* Brand logo. The asset is a transparent PNG of the mark itself — no tile, no
   backdrop — so it sits directly on the header. Intrinsic width/height are set
   on the element, so height + width:auto preserves the ratio exactly and the
   browser reserves the right space before the image loads (no layout shift). */
.brand__logo {
  height: 40px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  display: block;
  flex: none;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.brand__name {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  font-family: system-ui, "Segoe UI", sans-serif;
}

.brand__persian {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- main / footer ---------- */

.site-main {
  flex: 1 0 auto;
  padding-bottom: 4rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.6rem;
  margin-top: auto;
  background: rgba(0, 0, 0, 0.2);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.86rem;
}

.site-footer__copy {
  font-family: system-ui, sans-serif;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3rem);
  text-align: center;
}

.hero__eyebrow {
  font-family: system-ui, "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.hero__title {
  font-size: clamp(1.9rem, 5.2vw, 3.1rem);
  margin-bottom: 1.1rem;
}

.hero__lead {
  color: var(--text-muted);
  max-width: 42rem;
  margin-inline: auto;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
}

.hero__points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.8rem;
}

.pill {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.84rem;
}

/* ---------- tools grid ---------- */

.tools {
  padding-block: 1rem 2rem;
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: 1.4rem;
  padding-inline-start: 0.8rem;
  border-inline-start: 3px solid var(--accent);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}

.tool-card:not(.tool-card--disabled):hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.tool-card--disabled {
  opacity: 0.62;
}

.tool-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-card__icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.badge {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  border: 1px solid transparent;
}

.badge--active {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.3);
}

.badge--soon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border-color: var(--border);
}

.tool-card__title {
  font-size: 1.08rem;
}

.tool-card__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}

.tool-card__action {
  margin-top: 0.4rem;
  align-self: flex-start;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0.72rem 1.4rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
  text-align: center;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--danger);
}

/* ---------- tool page ---------- */

.tool-hero {
  padding-block: clamp(2rem, 5vw, 3.2rem) 1.6rem;
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.tool-hero__title {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  margin-bottom: 0.9rem;
}

.tool-hero__lead {
  color: var(--text-muted);
  max-width: 46rem;
}

.tool-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 780px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 1.8rem);
}

.panel--center {
  text-align: center;
}

.panel--success {
  border-color: rgba(74, 222, 128, 0.32);
  background: linear-gradient(180deg, var(--success-soft), transparent 45%), var(--panel);
  text-align: center;
}

.panel__title {
  font-size: 1.1rem;
  margin-bottom: 0.7rem;
}

.panel__hint {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.notes__list {
  margin: 0;
  padding-inline-start: 1.1rem;
  color: var(--text-muted);
  font-size: 0.94rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notes__list li::marker {
  color: var(--accent);
}

/* ---------- checklist ---------- */

.check-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.check-item {
  position: relative;
}

.check-item__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-item__label {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease;
  font-size: 0.94rem;
}

.check-item__label:hover {
  border-color: var(--border-strong);
}

.check-item__num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: system-ui, sans-serif;
  line-height: 1;
  transition: all 0.16s ease;
}

/* The number and the confirmation tick share one grid cell, so swapping them
   cannot shift the badge or the row height. */
.check-item__num-value,
.check-item__num-check {
  grid-area: 1 / 1;
  display: block;
}

.check-item__num-check {
  display: none;
  font-size: 0.95rem;
  font-weight: 700;
}

/* Confirmed state: green, never orange. Orange is reserved for calls to action
   and would read as a warning on a completed confirmation. */
.check-item__input:checked + .check-item__label {
  border-color: var(--confirm);
  background: var(--confirm-soft);
}

.check-item__input:checked + .check-item__label .check-item__num {
  background: var(--confirm);
  border-color: var(--confirm);
  color: var(--confirm-ink);
}

.check-item__input:checked + .check-item__label .check-item__num-value {
  display: none;
}

.check-item__input:checked + .check-item__label .check-item__num-check {
  display: block;
}

.check-item__input:focus-visible + .check-item__label {
  box-shadow: var(--focus);
}

/* ---------- uploader ---------- */

.uploader {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: clamp(1.6rem, 5vw, 2.6rem) 1.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone__icon {
  width: 38px;
  height: 38px;
  color: var(--accent);
}

.dropzone__title {
  font-weight: 600;
}

.dropzone__hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  max-width: 34rem;
}

.dropzone .btn {
  margin-top: 0.5rem;
}

.file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
}

.file-summary__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-summary__name {
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary__size {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.gate-hint {
  color: var(--text-dim);
  font-size: 0.84rem;
  text-align: center;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert--error {
  background: var(--danger-soft);
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffc9c9;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.1rem;
  color: var(--text-dim);
  font-size: 0.86rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.privacy-note svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent);
  margin-top: 0.25rem;
}

/* ---------- processing / result ---------- */

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  margin: 0 auto 1rem;
  animation: spin 0.9s linear infinite;
}

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

.processing__text {
  font-weight: 600;
}

.success-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  background: var(--success-soft);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.success-badge svg {
  width: 28px;
  height: 28px;
}

.success-title {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.verify-list {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: start;
}

.verify-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.verify-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--success);
  margin-top: 0.3rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ---------- error page ---------- */

.error-page {
  text-align: center;
  padding-block: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .container {
    width: min(1120px, 100% - 1.6rem);
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
  }

  .result-actions .btn {
    width: 100%;
  }

  .brand__persian {
    display: none;
  }

  .brand__logo {
    height: 34px;
    max-width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
