

:root {
  --container-width: 1200px;
  --header-height: 78px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.18);
  --shadow-card: 0 14px 30px rgba(0, 0, 0, 0.1);
  --border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] {
  --border-color: rgba(31, 41, 55, 0.08);
  --shadow-soft: 0 18px 40px rgba(17, 24, 39, 0.12);
  --shadow-card: 0 14px 30px rgba(17, 24, 39, 0.08);
}

html {
  scroll-behavior: smooth;

  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body, "Vazir", Tahoma, "Segoe UI", Arial, sans-serif);
  direction: rtl;
  text-align: right;
  background: var(--color-background);
  color: var(--color-text);
  overflow-x: clip;
  max-width: 100%;
}

body.modal-open {
  overflow: hidden;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(var(--container-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 18px 0 10px;
  backdrop-filter: blur(18px);
  background: rgba(11, 13, 16, 0.38);
  border-bottom: 1px solid transparent;
}

:root[data-theme="light"] .site-header {
  background: rgba(245, 245, 245, 0.42);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 24px;
  direction: rtl;
  padding: 10px 18px;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  background: rgba(21, 24, 29, 0.76);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

:root[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  color: #111827;
  font-weight: 700;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.brand-mark img,
.footer-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.brand-text {
  font-size: 1.2rem;
}

.nav-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 28px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.96rem;
  transition: color 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 159, 67, 0.4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.btn > i,
.btn > svg {
  flex: 0 0 auto;
  width: 1.1em;
  text-align: center;
  font-size: 0.95em;
}

.btn > svg {
  height: 1.1em;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  color: #111827;
  box-shadow: var(--shadow-card);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--color-surface);
  color: var(--color-text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease;
  content: "";
}

.nav-toggle span::before {
  position: absolute;
  top: -6px;
}

.nav-toggle span::after {
  position: absolute;
  top: 6px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.auth-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 12, 0.72);
  backdrop-filter: blur(10px);
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 24px));
  max-height: min(92vh, 660px);
  overflow: auto;
  padding: 26px 24px 22px;
  border: 1px solid var(--border-color);
  border-radius: 28px;
  background: rgba(21, 24, 29, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.28s ease;
}

.auth-modal.is-open .auth-modal__dialog {
  transform: translateY(0) scale(1);
}

:root[data-theme="light"] .auth-modal__dialog {
  background: rgba(255, 255, 255, 0.96);
}

.auth-modal__close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.auth-modal__header {
  margin-bottom: 18px;
}

.auth-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(255, 159, 67, 0.08);
  color: var(--color-primary);
  font-size: 0.74rem;
  font-weight: 700;
}

.auth-modal__title {
  margin: 14px 0 0;
  color: var(--color-text);
  font-size: clamp(1.6rem, 2vw, 2.1rem);
}

.auth-account-status {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: rgba(255, 159, 67, 0.06);
}

.auth-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 159, 67, 0.08);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.auth-account-status strong {
  color: var(--color-text);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form.is-hidden,
.auth-success.is-hidden {
  display: none;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field label {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.auth-input-wrap i {
  color: var(--color-text-muted);
  font-size: 0.96rem;
}

.auth-input-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text);
}

.auth-input-wrap input::placeholder {
  color: var(--color-text-muted);
}

.auth-password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--color-primary);
}

.auth-register-only {
  display: none;
}

.auth-register-only.is-visible {
  display: grid;
}

.auth-form__meta {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.auth-form__message {
  min-height: 20px;
  margin: -4px 0 0;
  font-size: 0.8rem;
  color: #fca5a5;
}

.auth-otp__header {
  text-align: center;
  margin-bottom: 8px;
}

.auth-otp__header p,
.auth-otp__header strong {
  margin: 0;
}

.auth-otp__header p {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.auth-otp__header strong {
  display: inline-block;
  margin-top: 8px;
  color: var(--color-text);
  font-size: 1.1rem;
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 10px;
}

.otp-input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  font-size: 1.15rem;
  text-align: center;
  outline: none;
}

.otp-input:focus {
  border-color: rgba(255, 159, 67, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.12);
}

.auth-otp__hint {
  margin: 0 0 4px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.auth-otp__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.auth-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-primary);
  font-weight: 700;
  cursor: pointer;
}

.auth-success {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding-top: 8px;
}

.auth-success__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(72, 187, 120, 0.12);
  color: #4ade80;
  font-size: 1.9rem;
}

.auth-success h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.8rem;
}

.auth-success p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.8;
}

@media (max-width: 540px) {
  .auth-modal {
    align-items: end;
    padding: 0 8px;
  }

  .auth-modal__dialog {
    width: min(100%, 360px);
    max-height: 82vh;
    margin: 0 auto 10px;
    border-radius: 20px 20px 14px 14px;
    padding: 18px 14px 16px;
    transform: translateY(20px) scale(1);
  }

  .auth-modal.is-open .auth-modal__dialog {
    transform: translateY(0) scale(1);
  }

  .auth-modal__close {
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
  }

  .auth-modal__header {
    margin-bottom: 12px;
    padding-left: 34px;
    padding-inline-end: 0;
  }

  .auth-modal__title {
    font-size: 1.35rem;
  }

  .auth-account-status {
    padding: 10px 12px;
  }

  .auth-status-badge {
    font-size: 0.66rem;
  }

  .auth-account-status strong {
    font-size: 0.9rem;
  }

  .auth-input-wrap {
    min-height: 48px;
    padding: 0 10px;
  }

  .auth-field label {
    font-size: 0.8rem;
  }

  .auth-form__meta,
  .auth-otp__hint,
  .auth-otp__actions,
  .auth-form__message {
    font-size: 0.72rem;
  }

  .otp-inputs {
    gap: 5px;
  }

  .otp-input {
    height: 40px;
    font-size: 0.95rem;
  }

  .auth-success h3 {
    font-size: 1.35rem;
  }
}

@media (min-width: 861px) and (max-width: 1024px) {
  .navbar {
    gap: 14px;
    padding: 10px 14px;
  }

  .brand-text {
    font-size: 1.1rem;
  }

  .nav-panel {
    gap: 14px;
    padding: 8px 6px;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  .nav-actions {
    gap: 8px;
  }

  .theme-toggle {
    padding: 0 12px;
  }

  .theme-toggle span {
    display: none;
  }

  .nav-actions .btn {
    padding: 0 14px;
  }
}

@media (max-width: 860px) {
  .site-header {
    padding-top: 10px;
  }

  .navbar {
    position: relative;
    padding: 8px 12px;
    gap: 12px;
    min-height: 64px;
  }

  .brand {
    flex-shrink: 0;
  }

  .nav-toggle {
    display: inline-flex;
    margin-inline-start: auto;
    flex-shrink: 0;
  }

  .nav-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 10px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 14px;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background: rgba(21, 24, 29, 0.96);
    box-shadow: var(--shadow-soft);

    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  :root[data-theme="light"] .nav-panel {
    background: rgba(255, 255, 255, 0.96);
  }

  .nav-panel.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
  }

  .nav-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
  }

  .nav-actions .btn,
  .hero__actions .btn,
  .home-cta-row .btn,
  .auth-modal .btn {
    width: 100%;
  }
}

.site-footer {
  margin-top: 48px;
  background: var(--color-surface);
  color: var(--color-text);
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 28px;
  padding: 52px 0 28px;
}

.footer-brand,
.footer-column {
  min-width: 0;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--color-text);
  font-weight: 700;
}

.footer-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  color: #111827;
  overflow: hidden;
}

.footer-brand p,
.footer-column p,
.footer-column a,
.footer-contact a {
  color: var(--color-text-muted);
  line-height: 1.8;
}

.footer-title {
  margin: 0 0 14px;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
}

.footer-links,
.footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.footer-links a,
.footer-social a,
.footer-contact a {
  transition: color 0.25s ease;
}

.footer-links a:hover,
.footer-social a:hover,
.footer-contact a:hover,
.footer-links a:focus-visible,
.footer-social a:focus-visible,
.footer-contact a:focus-visible {
  color: var(--color-text);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 24px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}
