@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #061224;
  --bg-soft: #0a1b36;
  --card: rgba(9, 24, 48, 0.86);
  --card-2: rgba(7, 20, 40, 0.92);
  --soft: rgba(255, 255, 255, 0.04);
  --border: rgba(120, 156, 226, 0.22);

  --text: #eef4ff;
  --muted: #9db0cf;

  --primary: #4f8cff;
  --primary-strong: #316dff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: 28px;
  --radius-sm: 18px;
  --radius-pill: 999px;

  --shadow: 0 24px 60px rgba(2, 8, 23, 0.35);

  --font-family-base: "Vazirmatn", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.light {
  color-scheme: light;

  --bg: #eef4ff;
  --bg-soft: #f8fbff;
  --card: rgba(255, 255, 255, 0.92);
  --card-2: rgba(255, 255, 255, 0.95);
  --soft: rgba(15, 23, 42, 0.04);
  --border: rgba(29, 78, 216, 0.14);

  --text: #0f172a;
  --muted: #52627e;

  --primary: #316dff;
  --primary-strong: #2458db;

  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(79, 140, 255, 0.18), transparent 26%),
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.08), transparent 18%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
textarea,
button,
select {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar,
.hero-card,
.section-card,
.panel-card,
.status-card,
.result-box,
.empty-state,
.tracking-code-box,
.picker-modal-panel {
  backdrop-filter: blur(16px);
}

.topbar,
.hero-card,
.section-card,
.panel-card,
.empty-state,
.result-box,
.status-card,
.tracking-code-box {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 12px;
  overflow: hidden;
  background: none;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  font-size: 1.2rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.main-content,
.workspace {
  display: grid;
  gap: 18px;
}

.hero-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.hero-copy h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1.2;
}

.hero-copy p,
.quick-actions-head p,
.empty-state p,
.status-card p,
.hero-point span,
.hint-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.eyebrow,
.section-kicker,
.quick-action-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow,
.section-kicker {
  font-size: 0.86rem;
}

.quick-action-kicker {
  font-size: 0.84rem;
  font-weight: 800;
}

.hero-points {
  display: grid;
  gap: 12px;
}

.hero-point {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

html.light .hero-point,
html.light .strength-box,
html.light .info-item,
html.light .picker-option {
  background: rgba(15, 23, 42, 0.025);
}

.hero-point strong {
  font-size: 0.96rem;
}

.section-card {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h3 {
  margin: 6px 0 0;
  font-size: 1.35rem;
}

.status-badge,
.status-pill {
  white-space: nowrap;
  font-size: 0.86rem;
  border-radius: var(--radius-pill);
}

.status-badge {
  padding: 9px 12px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--soft);
}

.split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.panel-card {
  padding: 16px;
  background: var(--card-2);
}

.panel-output {
  display: grid;
  align-content: start;
  gap: 14px;
}

.label {
  display: block;
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.6;
}

.input,
.textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  outline: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.22);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

html.light .input,
html.light .textarea {
  background: rgba(15, 23, 42, 0.03);
}

.input:focus,
.textarea:focus {
  border-color: rgba(79, 140, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.14);
}

.textarea {
  min-height: 120px;
  resize: none;
  line-height: 1.8;
}

.code-input {
  direction: ltr;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.panel-card > .input,
.panel-card > .textarea,
.panel-card > .expiry-picker,
.panel-card > .strength-box {
  margin-bottom: 18px;
}

#retrieveSection #retrieveCode {
  margin-bottom: 18px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  column-gap: 16px;
  row-gap: 12px;
  margin-bottom: 18px;
}

.meta-row,
.button-row,
.result-top,
.tracking-code-row,
.info-item,
.strength-topline {
  display: flex;
  align-items: center;
}

.meta-row {
  justify-content: space-between;
  margin: 8px 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.counter {
  display: inline-flex;
  gap: 4px;
}

.button-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  min-height: 46px;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  appearance: none;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 12px 28px rgba(49, 109, 255, 0.28);
}

.btn-secondary {
  color: var(--text);
  border-color: rgba(79, 140, 255, 0.25);
  background: rgba(79, 140, 255, 0.14);
}

.btn-soft {
  color: var(--text);
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.08);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--border);
  background: transparent;
}

.btn-inline {
  min-width: 88px;
  padding-inline: 14px;
}

.btn-sm {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 14px;
}

.strength-box {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.strength-topline {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.strength-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.16);
}

.strength-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
  transition:
    width 0.2s ease,
    background-color 0.2s ease;
}

.hint-text {
  margin-top: 14px;
  font-size: 0.9rem;
}

.empty-state,
.result-box,
.status-card,
.tracking-code-box {
  padding: 16px;
}

.hidden {
  display: none !important;
}

.result-top {
  justify-content: space-between;
  gap: 12px;
}

.result-top h4 {
  margin: 6px 0 0;
  font-size: 1.1rem;
}

.status-pill {
  padding: 8px 12px;
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 800;
}

.status-pill.neutral {
  color: var(--text);
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.14);
}

.status-pill.success {
  color: #b9f8cf;
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.16);
}

.status-pill.warning {
  color: #ffddb0;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.16);
}

.status-pill.danger {
  color: #ffc0c0;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.16);
}

html.light .status-pill.success {
  color: #166534;
}

html.light .status-pill.warning {
  color: #9a5b00;
}

html.light .status-pill.danger {
  color: #991b1b;
}

.tracking-code-box {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.tracking-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.tracking-code-row {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tracking-code {
  direction: ltr;
  font-size: clamp(1.3rem, 4vw, 2rem);
  letter-spacing: 0.18em;
}

.info-list {
  display: grid;
  gap: 12px;
}

.info-item {
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.info-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.info-item strong {
  line-height: 1.7;
  text-align: end;
}

.expiry-picker {
  margin-bottom: 18px;
}

.picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid rgba(79, 140, 255, 0.3);
  border-radius: 18px;
  cursor: pointer;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.24), rgba(44, 114, 255, 0.14)),
    rgba(79, 140, 255, 0.08);
  box-shadow:
    0 12px 28px rgba(49, 109, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

html.light .picker-trigger {
  border-color: rgba(49, 109, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.16), rgba(49, 109, 255, 0.06)),
    rgba(49, 109, 255, 0.04);
  box-shadow:
    0 10px 24px rgba(49, 109, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.picker-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 140, 255, 0.55);
  box-shadow:
    0 16px 32px rgba(49, 109, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.picker-trigger:focus-visible {
  outline: none;
  border-color: rgba(79, 140, 255, 0.7);
  box-shadow:
    0 0 0 4px rgba(79, 140, 255, 0.14),
    0 16px 32px rgba(49, 109, 255, 0.18);
}

.picker-trigger-text {
  font-size: 1rem;
  font-weight: 800;
}

.picker-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  opacity: 0.92;
}

.picker-trigger-icon svg {
  width: 18px;
  height: 18px;
}

.picker-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.picker-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.62);
}

.picker-modal-panel {
  position: absolute;
  inset-inline: 16px;
  bottom: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(2, 8, 23, 0.45);
}

.picker-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.picker-modal-head h4 {
  margin: 6px 0 0;
  font-size: 1.1rem;
}

.picker-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  background: rgba(148, 163, 184, 0.08);
}

.picker-options {
  display: grid;
  gap: 10px;
}

.picker-option {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  color: var(--text);
  text-align: start;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.picker-option:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 140, 255, 0.36);
}

.picker-option.active {
  border-color: rgba(79, 140, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.18), rgba(44, 114, 255, 0.08)),
    rgba(79, 140, 255, 0.08);
  box-shadow: 0 12px 28px rgba(49, 109, 255, 0.12);
}

.status-card {
  display: grid;
  gap: 8px;
}

.status-card h5 {
  margin: 0;
  font-size: 1.05rem;
}

.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 80;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 20px 40px rgba(2, 8, 23, 0.4);
}

html.light .toast {
  background: rgba(15, 23, 42, 0.9);
}

.quick-actions-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.quick-actions-head h2 {
  margin: 8px 0;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  line-height: 1.25;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.quick-action-btn {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(79, 140, 255, 0.26);
  border-radius: 24px;
  cursor: pointer;
  color: var(--text);
  text-align: start;
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.2), rgba(44, 114, 255, 0.08)),
    rgba(79, 140, 255, 0.06);
  box-shadow: 0 14px 30px rgba(49, 109, 255, 0.12);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

html.light .quick-action-btn {
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.14), rgba(44, 114, 255, 0.05)),
    rgba(49, 109, 255, 0.04);
  box-shadow: 0 12px 24px rgba(49, 109, 255, 0.08);
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 140, 255, 0.5);
  box-shadow: 0 18px 34px rgba(49, 109, 255, 0.16);
}

.quick-action-btn:focus-visible {
  outline: none;
  border-color: rgba(79, 140, 255, 0.7);
  box-shadow:
    0 0 0 4px rgba(79, 140, 255, 0.14),
    0 18px 34px rgba(49, 109, 255, 0.16);
}

.quick-action-btn strong {
  font-size: 1rem;
  line-height: 1.5;
}

.quick-action-btn small {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .app-shell {
    width: min(1240px, calc(100% - 36px));
    padding-top: 24px;
  }

  .hero-card {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: stretch;
  }

  .split-layout {
    grid-template-columns: 1fr 1fr;
  }

  .section-card {
    padding: 20px;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
  }

  .picker-modal-panel {
    width: min(460px, calc(100% - 32px));
    inset-inline: auto 24px;
    bottom: 24px;
  }

  html[dir="rtl"] .picker-modal-panel {
    inset-inline: 24px auto;
  }
}

@media (max-width: 767px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .btn {
    flex: 1;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
  }

  .btn-inline {
    width: 100%;
  }

  .tracking-code-row,
  .info-item,
  .result-top,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .button-row .btn {
    flex: 1 1 100%;
  }

  .picker-option {
    padding: 18px;
  }
}