@font-face {
  font-family: "IRANYekanXFaNum";
  src: url("/assets/fonts/IRANYekanXVFaNumVF.woff2") format("woff2-variations");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #f0f1ee;
  --text: #20211f;
  --text-secondary: #5d625c;
  --text-muted: #777c76;
  --border: #dfe2dc;
  --border-strong: #c8cdc5;
  --accent: #355d4b;
  --accent-hover: #284a3b;
  --accent-soft: #e9f0ec;
  --danger: #a43f37;
  --danger-soft: #faeeec;
  --warning: #826019;
  --warning-soft: #fbf4df;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --content-max: 1180px;
  font-family: "IRANYekanXFaNum", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 20;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(53, 93, 75, 0.34);
  outline-offset: 3px;
}

.loading-shell,
.no-script {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--text-secondary);
}

.loading-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.35; transform: scale(0.78); }
  to { opacity: 1; transform: scale(1); }
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.72fr);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(32px, 6vw, 88px);
  border-inline-end: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-weight: 740;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  font-weight: 820;
}

.auth-message {
  max-width: 620px;
  margin-block: auto;
  padding-block: 70px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 680;
}

.auth-message h1,
.dashboard-title h1,
.password-card h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 780;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.auth-message p {
  max-width: 520px;
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
}

.auth-note,
.identity-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-note::before,
.identity-note::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-block-start: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(24px, 5vw, 72px);
  background: var(--surface);
}

.auth-card,
.password-card {
  width: min(100%, 410px);
}

.auth-card h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.45;
}

.auth-card > p,
.password-card > p {
  margin: 8px 0 28px;
  color: var(--text-secondary);
}

.field {
  display: grid;
  gap: 7px;
  margin-block-end: 18px;
}

.field label {
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  padding: 10px 13px;
  direction: ltr;
  text-align: left;
}

.field input:hover {
  border-color: #aeb5ab;
}

.field input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(53, 93, 75, 0.15);
}

.field-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 9px 18px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 680;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
}

.alert {
  margin-block-end: 18px;
  border: 1px solid #edcfca;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 12px;
  font-size: 13px;
}

.password-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.password-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: clamp(24px, 5vw, 42px);
}

.password-card .brand {
  margin-block-end: 34px;
}

.password-card h1 {
  font-size: 30px;
}

.password-actions {
  display: grid;
  gap: 10px;
  margin-block-start: 24px;
}

.dashboard {
  min-height: 100vh;
}

.topbar {
  border-block-end: 1px solid var(--border);
  background: rgba(247, 247, 245, 0.96);
}

.topbar-inner,
.dashboard-main {
  width: min(calc(100% - 40px), var(--content-max));
  margin-inline: auto;
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-copy {
  display: grid;
  text-align: end;
  line-height: 1.45;
}

.user-copy strong {
  font-size: 13px;
}

.user-copy span {
  color: var(--text-muted);
  font-size: 11px;
}

.dashboard-main {
  padding-block: clamp(44px, 7vw, 84px) 72px;
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-block-end: 34px;
}

.dashboard-title {
  max-width: 720px;
}

.dashboard-title h1 {
  font-size: clamp(30px, 5vw, 48px);
}

.dashboard-title p {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.app-count {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 13px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.app-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 176px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 24px;
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.app-card[data-enabled="true"]:hover {
  border-color: #aeb8b0;
  background: #fdfefd;
  transform: translateY(-2px);
}

.app-card[data-enabled="false"] {
  color: var(--text-muted);
}

.app-monogram {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.app-card[data-icon="measure"] .app-monogram {
  background: #edf1f5;
  color: #3f5c72;
}

.app-copy h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
}

.app-copy p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.app-meta {
  display: grid;
  justify-items: end;
  gap: 18px;
}

.status {
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.status[data-status="maintenance"] {
  background: var(--warning-soft);
  color: var(--warning);
}

.status[data-status="coming_soon"] {
  background: var(--surface-soft);
  color: var(--text-muted);
}

.launch-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.app-card[data-enabled="false"] .launch-label {
  color: var(--text-muted);
}

.identity-note {
  max-width: 760px;
  margin-block-start: 26px;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: auto;
    padding: 32px 24px;
    border-inline-end: 0;
    border-block-end: 1px solid var(--border);
  }

  .auth-message {
    padding-block: 52px 32px;
  }

  .auth-panel {
    min-height: auto;
    padding: 48px 24px 64px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar-inner,
  .dashboard-main {
    width: min(calc(100% - 28px), var(--content-max));
  }

  .topbar-inner {
    min-height: 68px;
  }

  .topbar .brand > span:last-child {
    display: none;
  }

  .user-copy {
    display: none;
  }

  .dashboard-heading {
    display: grid;
    align-items: start;
  }

  .app-count {
    width: fit-content;
  }

  .app-card {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 0;
    padding: 20px;
  }

  .app-monogram {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .app-meta {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
    width: 100%;
    padding-block-start: 12px;
    border-block-start: 1px solid var(--border);
  }

  .launch-label {
    justify-self: end;
  }

  .password-page {
    align-items: start;
    padding: 14px;
  }

  .password-card {
    margin-block-start: 14px;
    border-radius: var(--radius-lg);
  }
}

