/* Dark glass theme */
:root {
  --bg-0: #060a12;
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.2);
  --text: #e8eef8;
  --accent: #38bdf8;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --ring: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

html { color-scheme: dark; }

body.app-shell {
  min-height: 100vh;
  font-family: IRANSansX, Tahoma, 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 15% 12%, rgba(56, 189, 248, 0.1), transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 78%, rgba(45, 212, 191, 0.08), transparent 50%),
    linear-gradient(165deg, #060a12 0%, #0b1220 45%, #111827 100%);
}

#app { position: relative; z-index: 1; }

/* آیکن‌های UI از پک Lucide */
iconify-icon.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  color: inherit;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fade-up {
  animation: fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fade-up-delay-1 { animation-delay: 0.06s; }

.glass {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

.glass-strong {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow);
}

.glass-hover {
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.glass-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(30, 41, 59, 0.85);
}

.icon-glow {
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.95), rgba(45, 212, 191, 0.85));
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.28);
}

.icon-glow-amber {
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.28);
}

.icon-glow-teal {
  background: linear-gradient(145deg, #2dd4bf, #14b8a6);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.28);
}

.btn-primary {
  background: linear-gradient(135deg, #0369a1, #0e7490 55%, #0f766e);
  background-size: 160% 160%;
  color: #e0f2fe;
  font-weight: 800;
  border: 1px solid rgba(125, 211, 252, 0.28);
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background-position 0.4s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
  filter: brightness(1.08);
  background-position: 100% 50%;
  box-shadow: 0 14px 34px rgba(14, 165, 233, 0.35);
}

.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.22);
  transform: translateY(-1px);
}

.field {
  background: rgba(2, 6, 23, 0.72) !important;
  border: 1px solid var(--glass-border);
  color: var(--text) !important;
  color-scheme: dark;
  caret-color: var(--accent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field::placeholder { color: #64748b; }

.field:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: var(--ring);
  background: rgba(2, 6, 23, 0.9) !important;
}

.field-error {
  border-color: rgba(248, 113, 113, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18) !important;
  background: rgba(70, 15, 20, 0.75) !important;
}

/* جلوگیری از پس‌زمینه سفید autofill مرورگر */
.field:-webkit-autofill,
.field:-webkit-autofill:hover,
.field:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent);
  box-shadow: 0 0 0 1000px #0b1220 inset !important;
  border-color: var(--glass-border);
  transition: background-color 99999s ease-in-out 0s;
}

body.app-shell input,
body.app-shell textarea,
body.app-shell select,
body.app-shell button {
  color-scheme: dark;
}

body.app-shell ::selection {
  background: rgba(56, 189, 248, 0.35);
  color: #fff;
}

body.app-shell img[alt="کپچا"] {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* اسکرول‌بار تیره */
body.app-shell *::-webkit-scrollbar { width: 8px; height: 8px; }
body.app-shell *::-webkit-scrollbar-track { background: transparent; }
body.app-shell *::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
body.app-shell *::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

.progress-track {
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, #0ea5e9, #2dd4bf, #0ea5e9);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* ——— راهنمای ارسال کد ——— */
.guide-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 70% 50% at 15% 12%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 78%, rgba(45, 212, 191, 0.1), transparent 50%),
    linear-gradient(165deg, #060a12 0%, #0b1220 45%, #111827 100%);
}

.guide-screen-close {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.guide-screen-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.guide-screen-inner {
  width: min(100%, 30rem);
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

@media (min-width: 768px) {
  .guide-screen-inner {
    width: fit-content;
    max-width: calc(100vw - 3rem);
  }
}

.guide-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
  text-align: center;
}

.guide-step-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.guide-step-text {
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.55;
  color: #e2e8f0;
  text-align: center;
}

.guide-site,
.guide-code {
  margin: 0;
  max-width: 100%;
  font-size: clamp(3.2rem, 14vw, 4.5rem);
  font-weight: 400;
  text-align: center;
  color: #f8fafc;
}

.guide-site {
  width: 100%;
  line-height: 1.05;
  letter-spacing: 0.04em;
  direction: ltr;
  overflow-wrap: anywhere;
  word-break: break-all;
}

@media (min-width: 768px) {
  .guide-site {
    width: max-content;
    max-width: none;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
}

.guide-code {
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 2.5rem;
}

/* ——— صفحه share ——— */
.share-note {
  padding: 0.9rem 1.1rem 1.1rem;
  border-radius: 1rem;
}

.share-note-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.55rem;
}

.share-note-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7dd3fc;
}

.share-note-body {
  font-size: 0.95rem;
  line-height: 1.85;
  color: #e2e8f0;
  overflow-wrap: anywhere;
}

.share-note-body > :first-child { margin-top: 0; }
.share-note-body > :last-child { margin-bottom: 0; }

.share-files-section.has-note {
  margin-top: 1.1rem;
}

.share-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.share-files-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

.share-files-count {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f1f5f9;
}

.share-files-total {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.share-files-zip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  border-radius: 0.8rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.share-files {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .share-files {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

.share-file-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.95rem;
  padding: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.share-file-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(30, 41, 59, 0.78);
}

.share-file-preview {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 23, 0.55);
  margin: 0;
}

.share-file-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.share-file-card:hover .share-file-preview img {
  transform: scale(1.03);
}

.share-file-preview-ext {
  display: grid;
  place-items: center;
  background: linear-gradient(165deg, rgba(36, 48, 68, 0.98), rgba(12, 18, 32, 0.98));
}

.share-file-ext {
  font-size: clamp(1.2rem, 3.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #cbd5e1;
  text-transform: uppercase;
}

.share-file-body {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: auto;
  padding: 0.7rem 0.75rem 0.8rem;
}

.share-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  direction: rtl;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
}

.share-file-size {
  margin-top: 0.2rem;
  text-align: right;
  font-size: 0.7rem;
  color: #64748b;
}

.share-file-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex-shrink: 0;
  border-radius: 0.7rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.72rem;
}

@media (max-width: 420px) {
  .share-file-dl span { display: none; }
  .share-file-dl { padding: 0.5rem; }
}

/* ——— صفحه لاگین پنل ——— */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}

.login-main {
  width: 100%;
  max-width: 24rem;
}

.login-brand {
  margin-bottom: 2rem;
  text-align: center;
}


.dashboard-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.65rem;
  font-size: 0.875rem;
}

.dashboard-nav button {
  padding: 0.2rem 0.15rem;
  font-weight: 600;
  color: #94a3b8;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.dashboard-nav button:hover:not(:disabled) {
  color: #7dd3fc;
}

.dashboard-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.share-text-input {
  /* حداکثر ۶ خط (leading-7 + py-2.5) */
  min-height: 2.75rem;
  max-height: calc(6 * 1.75rem + 1.25rem);
  overflow-y: auto;
}

/* ——— دراپ‌زون فشرده ——— */
.dropzone-picked {
  margin-top: 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 23, 0.35);
  padding: 0.55rem 0.6rem 0.65rem;
}

.dropzone-picked-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.dropzone-clear {
  border: 0;
  background: transparent;
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.dropzone-clear:hover {
  color: #fecaca;
}

.dropzone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr));
  gap: 0.4rem;
  max-height: 10.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.dropzone-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.85);
}

.dropzone-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropzone-tile-ext {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #94a3b8;
  text-transform: uppercase;
}

.dropzone-tile-remove {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.dropzone-tile-remove:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.85);
}

.link-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.9rem 1rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.link-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.link-card-previews {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.link-card-preview,
.link-card-preview-more {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.65rem;
  border: 2px solid rgba(15, 23, 42, 0.95);
  background: rgba(2, 6, 23, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.link-card-preview + .link-card-preview,
.link-card-preview + .link-card-preview-more {
  margin-inline-start: -0.55rem;
}

.link-card-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card-preview-ext {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
}

.link-card-ext {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  color: #cbd5e1;
  text-transform: uppercase;
}

.link-card-preview-more {
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.95);
}

.link-card-menu {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.link-card-menu-btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.link-card-menu-btn:hover,
.link-card-menu-btn[aria-expanded="true"] {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
}

.link-card-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 7.75rem;
  padding: 0.3rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #0b1220;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

.link-card-menu-panel button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.55rem 0.75rem;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.link-card-menu-panel button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.link-card-menu-panel button.is-danger {
  color: #fca5a5;
}

.link-card-menu-panel button.is-danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.link-card-title {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
  color: #f1f5f9;
  cursor: pointer;
  transition: color 0.15s ease;
}

.link-card-title:hover {
  color: #7dd3fc;
}

.link-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.4rem;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: #64748b;
}

.link-card-meta .dot {
  opacity: 0.45;
}

.dashboard-nav span {
  color: #475569;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.login-field {
  text-align: right;
}

.login-input {
  font-size: 1.05rem;
  line-height: 1.5;
}

.login-field > label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #94a3b8;
}

.login-field-error {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fca5a5;
}

.login-error {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(127, 29, 29, 0.25);
  font-size: 0.84rem;
  font-weight: 700;
  color: #fecaca;
  text-align: right;
}

.login-captcha {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
}

.login-captcha-img {
  flex-shrink: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  overflow: hidden;
  background: #0b1220;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.login-captcha-img:hover {
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.login-captcha-img img {
  display: block;
  width: 10rem;
  height: 3.25rem;
  object-fit: cover;
}

.login-submit {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 0.95rem;
  padding: 0.95rem 1.25rem;
  font-size: 0.95rem;
}

/* ——— صفحه ورود کد ——— */
.home-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}

.home-main {
  width: 100%;
  max-width: 26rem;
  text-align: center;
}

.home-brand {
  margin-bottom: 2.25rem;
}

.home-brand-name {
  margin: 0 0 0.85rem;
  font-size: clamp(2.35rem, 8vw, 3.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(120deg, #f8fafc 10%, #7dd3fc 55%, #5eead4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: home-brand-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-brand-name.dashboard-brand-name,
a.home-brand-name.dashboard-brand-name,
a.home-brand-name.dashboard-brand-name:hover,
a.home-brand-name.dashboard-brand-name:focus,
a.home-brand-name.dashboard-brand-name:visited,
a.home-brand-name.dashboard-brand-name:active {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
  text-align: start;
  animation: none;
  text-decoration: none;
  cursor: pointer;
  color: transparent;
  outline: none;
}

.home-title {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.7;
  color: #94a3b8;
}

.home-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.home-code {
  position: relative;
  cursor: text;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-code.is-error {
  animation: home-shake 0.4s ease;
}

.home-code-slots {
  display: flex;
  gap: 0.45rem;
  direction: ltr;
  pointer-events: none;
}

.home-code-slot {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  min-width: 0;
  min-height: 4.25rem;
  border-radius: 0.85rem;
  font-size: clamp(2.4rem, 11vw, 3.1rem);
  font-weight: 400;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.home-code-slot:nth-child(3) {
  margin-inline-end: 0.85rem;
}

.home-code-digit {
  display: block;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  /* اصلاح بصری متریک فونت برای ارقام فارسی */
  transform: translateY(0.06em);
}

.home-code-slot.filled {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(14, 116, 144, 0.18);
  color: #e0f2fe;
}

.home-code-slot.active {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 116, 144, 0.28);
}

.home-code-slot.caret::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 1.85rem;
  margin: 0;
  background: #38bdf8;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  animation: home-caret 1s steps(1) infinite;
}

.home-code-slot.filled.caret::after {
  display: none;
}

.home-code.is-error .home-code-slot {
  border-color: rgba(248, 113, 113, 0.55);
}

.home-code.is-ready .home-code-slot.filled {
  border-color: rgba(45, 212, 191, 0.55);
}

.home-code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  margin: 0;
  padding: 0;
  caret-color: transparent;
  color: transparent;
  background: transparent;
  cursor: text;
}

.home-error {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fca5a5;
}

.home-submit {
  width: 100%;
  border-radius: 0.95rem;
  padding: 0.95rem 1.25rem;
  font-size: 0.95rem;
}

@keyframes home-brand-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes home-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes home-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 380px) {
  .home-code-slot {
    min-height: 3.5rem;
    font-size: 2.35rem;
    border-radius: 0.7rem;
  }
  .home-code-slots { gap: 0.3rem; }
  .home-code-slot:nth-child(3) { margin-inline-end: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
