@font-face {
  font-family: "Vazir FD";
  src: url("../fonts/VazirFD/Vazir-Regular-FD-WOL.woff2") format("woff2"),
       url("../fonts/VazirFD/Vazir-Regular-FD-WOL.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazir FD";
  src: url("../fonts/VazirFD/Vazir-Medium-FD-WOL.woff2") format("woff2"),
       url("../fonts/VazirFD/Vazir-Medium-FD-WOL.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazir FD";
  src: url("../fonts/VazirFD/Vazir-Bold-FD-WOL.woff2") format("woff2"),
       url("../fonts/VazirFD/Vazir-Bold-FD-WOL.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Wizard and time-grid styles */
.wizard {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 24px 22px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}
.wizard-header {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.progress-indicator {
  position: relative;
  width: min(280px, 100%);
  height: 18px;
  display: flex;
  align-items: center;
}
.progress-line {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: var(--border);
  border-radius: 999px;
}
.progress-dots {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  transition: all 200ms ease;
  cursor: default;
}
.progress-dot.is-active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--surface);
}

.wizard-body .wizard-step { transition: opacity .16s ease; }
.wizard-actions { display:flex; gap:12px; justify-content:center; margin-top:24px; }

.wizard-step-head {
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-bottom: 16px;
}

.wizard-back-btn {
  position: absolute;
  top: -4px;
  right: 0;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 160ms ease;
}

.wizard-back-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.wizard-back-btn .icon-asset {
  width: 18px;
  height: 18px;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
  max-height: 360px;
  overflow: auto;
}
.time-slot {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  font-weight: 600;
}
.time-slot:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.time-slot.is-in-range { background: linear-gradient(90deg, rgba(37,99,235,0.06), rgba(14,165,233,0.04)); border-color: rgba(37,99,235,0.12); }
.time-slot.is-selected-start, .time-slot.is-selected-end { background: linear-gradient(90deg, var(--primary), var(--accent)); color: white; box-shadow: var(--shadow-md); }
.time-range-display { display:flex; gap:24px; margin-top:8px; color: var(--text-muted); }

/* Time-picker inputs */
.time-picker-group { display:flex; flex-direction:column; gap:14px; align-items:center; }
.time-picker { display:flex; flex-direction:column; gap:8px; width:100%; max-width:360px; }
.time-picker-label { font-weight:600; color:var(--text-muted); font-size:0.9rem; }
.time-picker-controls { display:flex; align-items:center; gap:8px; justify-content:center; direction:ltr; }
.number-input { display:inline-flex; align-items:center; gap:4px; border-radius:8px; overflow:hidden; direction:ltr; }
.number-input.hour { order: 1; }
.sep { order: 2; }
.number-input.minute { order: 3; }
.number-input .spin { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; background:transparent; border:none; cursor:pointer; color:var(--text-muted); font-weight:700; font-size:0.6rem; transition:all 120ms ease; padding:0; }
.number-input .spin:hover { color:var(--primary); }
.number-input .spin:active { transform:scale(0.92); }
.number-input input.time-input { width:54px; padding:8px 4px; border:0; border-bottom:1px solid var(--border); border-radius:0; text-align:center; font-weight:700; background:var(--surface-strong); color:var(--text); -webkit-text-fill-color: var(--text); caret-color: var(--primary); font-size:1rem; outline:none; appearance:textfield; }
.number-input input.time-input::-webkit-outer-spin-button,
.number-input input.time-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.number-input input.time-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.number-input input.time-input:focus { border-bottom-color: var(--primary); }
.sep { font-weight:700; color:var(--text-muted); font-size:1rem; }
@media (max-width:720px) { .number-input input.time-input { width:48px; padding:6px 4px; font-size:0.92rem; } }

.wizard-actions .btn[data-wizard-next] {
  min-width: 120px;
}

.wizard-actions .btn[data-wizard-next].is-cta-disabled {
  opacity: 0.45;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}

.wizard-actions .btn[data-wizard-next].is-cta-ready {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-md);
}

.wizard-actions .btn[data-wizard-next].is-cta-ready:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.form-card {
  border: none;
  width: 100%;
  align-items: stretch;
}

.header-text {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.header-text h1 {
  font-size: 2.25rem;
  line-height: 1.1;
  margin: 0;
}

.section-header {
  margin-bottom: 10px;
}

.wizard-step .section-title h2 {
  font-size: 1.32rem;
}

.section-title {
  margin-bottom: 10px;
}

.wizard-step[data-step="2"] .section-title {
  margin-top: -6px;
}

@media (min-width: 1024px) {
  .form-card {
    padding-left: 36px;
    padding-right: 36px;
  }
  .wizard {
    padding-left: 36px;
    padding-right: 36px;
  }
}



:root {
  --bg: #f8fafc;
  --bg-elevated: rgba(255, 255, 255, 0.85);
  --surface: rgba(255, 255, 255, 0.95);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(37, 99, 235, 0.12);
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent: #0ea5e9;
  --shadow-sm: 0 4px 12px rgba(37, 99, 235, 0.08);
  --shadow-md: 0 12px 32px rgba(37, 99, 235, 0.12);
  --shadow-lg: 0 20px 52px rgba(37, 99, 235, 0.15);
  --radius: 16px;
  --radius-lg: 24px;
  --icon-filter: none;
  --scrollbar-track: rgba(148, 163, 184, 0.14);
  --scrollbar-thumb: rgba(37, 99, 235, 0.45);
  --scrollbar-thumb-hover: rgba(37, 99, 235, 0.65);
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --bg-elevated: rgba(15, 23, 42, 0.8);
  --surface: rgba(15, 23, 42, 0.95);
  --surface-strong: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.15);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.4);
  --icon-filter: invert(1) brightness(2.4);
  --scrollbar-track: rgba(15, 23, 42, 0.35);
  --scrollbar-thumb: rgba(148, 163, 184, 0.34);
  --scrollbar-thumb-hover: rgba(148, 163, 184, 0.5);
}

* {
  box-sizing: border-box;
}

.icon-asset {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: var(--icon-filter);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Vazir FD", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 40%),
    radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.06), transparent 35%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea,
optgroup,
label {
  font: inherit;
}

select {
  direction: rtl;
  text-align: right;
}

/* Layout */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand strong {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: "Inter", "Vazir FD", system-ui, sans-serif;
  letter-spacing: 0.4px;
}

.brand small {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.brand-mark .brand-icon {
  width: 30px;
  height: 30px;
  filter: invert(1) brightness(3);
}

.theme-toggle {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 200ms ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.theme-toggle .icon-asset {
  width: 20px;
  height: 20px;
}

html[data-theme="light"] .icon-moon,
html[data-theme="dark"] .icon-sun {
  display: none;
}

.page-wrap {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 20px;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.flash {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.flash-error {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 200ms ease;
  font-weight: 500;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-ghost:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-full {
  width: 100%;
}

/* Landing Hero */
.landing-hero {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-content h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.feature-highlights {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-highlights li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.feature-highlights strong {
  font-weight: 600;
}

.icon-dot {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
}

.icon-dot .icon-asset {
  width: 14px;
  height: 14px;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  width: min(560px, 100%);
}

.grid-demo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.grid-header {
  height: 36px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.grid-slot {
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: background 200ms ease;
}

.grid-slot.density-0 {
  background: rgba(148, 163, 184, 0.08);
}

.grid-slot.density-1 {
  background: rgba(37, 99, 235, 0.18);
}

.grid-slot.density-2 {
  background: rgba(37, 99, 235, 0.32);
}

.grid-slot.density-3 {
  background: rgba(37, 99, 235, 0.50);
}

.grid-slot.density-4,
.grid-slot.density-5,
.grid-slot.density-6 {
  background: rgba(37, 99, 235, 0.70);
}

.grid-slot.density-7,
.grid-slot.density-8,
.grid-slot.density-9 {
  background: rgba(30, 58, 138, 0.88);
}

.visual-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Features Section */
.features-section {
  display: grid;
  gap: 32px;
  margin-top: 48px;
}

.features-section h2 {
  font-size: 1.8rem;
  margin: 0;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all 200ms ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--primary-dark);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.feature-icon .icon-asset {
  width: 26px;
  height: 26px;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  font-weight: 600;
}

.feature-card p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* Form Styles */
.form-container {
  max-width: 780px;
  margin: 0 auto;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

html.is-page-loading .form-container {
  opacity: 0.72;
  transform: translateY(2px);
  filter: saturate(0.95);
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-header {
  margin-bottom: 32px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.header-text h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
}

.section-title {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  text-align: center;
}

.section-title h2 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
}

.section-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-section {
  border: none;
  padding: 0;
  margin: 0 0 32px 0;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Calendar Styles */
.calendar-wrapper {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.month-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.month-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: 200ms ease;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.month-nav-btn .icon-asset {
  width: 14px;
  height: 14px;
}

.month-nav-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.month-nav-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.weekday-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 10px;
}

.day-btn {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  font-size: 0.84rem;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.day-btn.is-today {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.day-btn.is-past {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.day-btn.is-past:hover {
  transform: none;
  background: rgba(148, 163, 184, 0.08);
}

.day-btn:disabled {
  pointer-events: none;
}

.day-btn:hover {
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.day-btn.is-selected-start,
.day-btn.is-selected-end {
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

html[data-theme="light"] .day-btn.is-selected-start,
html[data-theme="light"] .day-btn.is-selected-end {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.14));
  color: var(--primary-dark);
  border-color: rgba(37, 99, 235, 0.24);
}

html[data-theme="dark"] .day-btn.is-selected-start,
html[data-theme="dark"] .day-btn.is-selected-end {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: white;
}

.day-btn.is-selected-start::after,
.day-btn.is-selected-end::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.day-btn.is-in-range {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
  border-color: rgba(37, 99, 235, 0.14);
}

.day-placeholder {
  height: 32px;
}

.range-display {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.range-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.range-value {
  font-weight: 700;
  font-family: "Vazir FD", system-ui, sans-serif;
  letter-spacing: 0;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.title-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-input span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.title-input input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  transition: 200ms ease;
}

.title-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Time Input Group */
.time-input-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.form-input-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-input-label span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.form-input-label input,
.form-input-label select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  transition: 200ms ease;
}

.form-input-label input:focus,
.form-input-label select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input-label select option {
  background: var(--surface-strong);
  color: var(--text);
  padding: 8px;
}

.form-input-label select optgroup {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  padding: 8px 0;
}

.form-input-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

/* Meeting Grid */
.meeting-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

.meeting-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-content: start;
  max-height: max-content;
  position: sticky;
  top: 20px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card h1,
.sidebar-card h2 {
  margin: 8px 0 0;
  font-size: 1.1rem;
}

.meeting-sidebar .sidebar-card {
  gap: 14px;
}

.sidebar-card h2 {
  margin-top: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}

.sidebar-card .title-input {
  margin-top: 8px;
}

.sidebar-card .btn-full {
  margin-top: 20px;
}

.sidebar-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.link-box {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  font-size: 0.85rem;
  margin-top: 8px;
}

.link-box .link-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.copy-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--primary-dark);
  font-size: 0.82rem;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(1px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-status-inline.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-status-inline .status-icon {
  width: 14px;
  height: 14px;
  display: block;
  filter: var(--icon-filter);
}

.copy-link-btn {
  /* min-width: 76px; */
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: 180ms ease;
  font-family: "Vazir FD", system-ui, sans-serif;
}

.copy-link-btn .icon-asset {
  width: 14px;
  height: 14px;
}

.copy-link-btn:hover {
  border-color: rgba(37, 99, 235, 0.38);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.copy-link-btn.is-copied {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary-dark);
}

.participant-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.participant-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(37, 99, 235, 0.05);
}

.participant-chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent, var(--primary));
  flex-shrink: 0;
}

.participant-chip strong {
  font-weight: 600;
  font-size: 0.9rem;
}

.participant-chip small {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: auto;
}

/* Meeting Main */
.meeting-main {
  display: grid;
  gap: 12px;
  align-content: start;
  align-self: start;
}

.mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  width: min(100%, 280px);
  justify-self: start;
  align-items: center;
}

@media (min-width: 769px) {
  .mode-switch {
    justify-self: center;
  }
}

.mode-switch-btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  height: 100%;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  transition: 160ms ease;
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.88rem;
  white-space: nowrap;
}

.mode-switch-btn.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--text);
  border-radius: 11px;
  box-shadow: none;
}

.mode-switch-btn:hover {
  color: var(--text);
}

.meeting-main.is-edit-mode .grid-card {
  position: relative;
  min-height: auto;
  height: auto;
  align-self: start;
}

.meeting-main.is-edit-mode .grid-card.is-locked {
  min-height: clamp(420px, 62vh, 760px);
}

@media (max-width: 768px) {
  .meeting-main.is-edit-mode .grid-card.is-locked {
    min-height: clamp(360px, 68vh, 640px);
  }
}

.grid-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html[data-theme="dark"] .grid-lock-overlay {
  background: rgba(15, 23, 42, 0.38);
}

.grid-lock-box {
  max-width: 360px;
  width: min(100%, 360px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.grid-lock-box h3 {
  margin: 0;
}

.grid-lock-box [data-join-status] {
  margin: 2px 0 0;
}

.grid-lock-box .title-input,
.grid-lock-box .btn-full {
  width: 100%;
}

.grid-lock-box .title-input input {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .grid-lock-box {
    max-width: 460px;
    width: min(100%, 460px);
    padding: 22px;
  }
}

.grid-lock-icon {
  width: 36px;
  height: 36px;
}

.grid-lock-box strong {
  font-size: 1rem;
}

.grid-lock-box p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.meeting-main.is-view-mode .grid-card,
.meeting-main.is-view-mode .participant-card-mobile,
.meeting-main.is-view-mode .insight-grid {
  filter: none;
}

.meeting-main.is-edit-mode .grid-card.is-locked .grid-scroll,
.meeting-main.is-edit-mode .grid-card.is-locked .availability-grid {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.meeting-main.is-edit-mode .grid-card.is-locked .grid-lock-overlay {
  display: grid;
}

.meeting-main.is-edit-mode .grid-card:not(.is-locked) .grid-lock-overlay {
  display: none;
}

@media (max-width: 480px) {
  .mode-switch {
    width: 100%;
    gap: 3px;
  }

  .mode-switch-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.meeting-hero {
  display: grid;
  gap: 16px;
}

.meeting-hero h2 {
  margin: 0;
  font-size: 1.2rem;
}

.meeting-hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.legend-box {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Grid Card */
.grid-card {
  overflow: hidden;
  position: relative;
  /* padding: 0; */
  align-self: start;
}

.grid-scroll {
  overflow: auto;
  border-radius: 12px;
  height: auto;
  max-height: min(72vh, 860px);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.grid-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.grid-scroll::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

.grid-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.grid-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.availability-grid {
  display: grid;
  grid-template-columns: 84px repeat(7, minmax(70px, 1fr));
  gap: 2px;
  background: var(--border);
  padding: 2px;
  min-width: fit-content;
  grid-auto-rows: 14px;
  align-content: start;
}

.grid-corner,
.time-head,
.day-head,
.slot-cell {
  min-height: auto;
  background: var(--surface-strong);
  display: grid;
  place-items: center;
  text-align: center;
}

.grid-corner,
.time-head,
.day-head {
  position: sticky;
  z-index: 2;
}

.grid-corner {
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 4;
  background: var(--surface-strong) !important;
  background-color: var(--surface-strong) !important;
  background-image: none !important;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
}

.day-head {
  top: 0;
  z-index: 3;
}

.time-head {
  inset-inline-start: 0;
  z-index: 3;
}

.grid-corner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.1));
  border-radius: 12px;
  color: var(--primary-dark);
  gap: 2px;
}

.day-head {
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 4px;
  min-height: 48px;
}

.time-head {
  background: var(--surface-strong);
  font-weight: 700;
  padding: 0 6px;
}

.day-head strong {
  font-weight: 700;
}

.day-head small {
  color: var(--text-muted);
}

.day-head .weekday {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.1;
}
.day-head .month-day {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}
.day-head .jalali-small {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.time-head {
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 84px;
  min-height: auto;
  height: 100%;
  align-self: stretch;
  padding: 4px 6px;
  line-height: 1.25;
}

.slot-cell {
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
  font-weight: 700;
  border-radius: 8px;
  height: 100%;
  min-height: unset;
  max-height: 14px;
  align-self: stretch;
  justify-self: stretch;
}

.slot-cell:hover {
  transform: translateY(-1px);
}

.slot-cell span {
  display: none;
}

/* Density coloring for availability cells - linear opacity progression */
.slot-cell.density-0 {
  background: rgba(148, 163, 184, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.06);
}
.slot-cell.density-1 {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.08);
}
.slot-cell.density-2 {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.10);
}
.slot-cell.density-3 {
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.12);
}
.slot-cell.density-4 {
  background: rgba(37, 99, 235, 0.20);
  border: 1px solid rgba(37, 99, 235, 0.14);
}
.slot-cell.density-5 {
  background: rgba(37, 99, 235, 0.24);
  border: 1px solid rgba(37, 99, 235, 0.16);
}
.slot-cell.density-6 {
  background: rgba(37, 99, 235, 0.28);
  border: 1px solid rgba(37, 99, 235, 0.18);
}
.slot-cell.density-7 {
  background: rgba(37, 99, 235, 0.32);
  border: 1px solid rgba(37, 99, 235, 0.20);
}
.slot-cell.density-8 {
  background: rgba(37, 99, 235, 0.36);
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.slot-cell.density-9 {
  background: rgba(37, 99, 235, 0.40);
  border: 1px solid rgba(37, 99, 235, 0.24);
}
.slot-cell.density-10 {
  background: rgba(37, 99, 235, 0.44);
  border: 1px solid rgba(37, 99, 235, 0.26);
}
.slot-cell.density-11 {
  background: rgba(37, 99, 235, 0.48);
  border: 1px solid rgba(37, 99, 235, 0.28);
}
.slot-cell.density-12 {
  background: rgba(37, 99, 235, 0.52);
  border: 1px solid rgba(37, 99, 235, 0.30);
}
.slot-cell.density-13 {
  background: rgba(37, 99, 235, 0.56);
  border: 1px solid rgba(37, 99, 235, 0.32);
}
.slot-cell.density-14 {
  background: rgba(37, 99, 235, 0.60);
  border: 1px solid rgba(37, 99, 235, 0.34);
}
.slot-cell.density-15 {
  background: rgba(37, 99, 235, 0.64);
  border: 1px solid rgba(37, 99, 235, 0.36);
}
.slot-cell.density-16 {
  background: rgba(37, 99, 235, 0.68);
  border: 1px solid rgba(37, 99, 235, 0.38);
}
.slot-cell.density-17 {
  background: rgba(37, 99, 235, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.40);
}
.slot-cell.density-18 {
  background: rgba(37, 99, 235, 0.76);
  border: 1px solid rgba(37, 99, 235, 0.42);
}
.slot-cell.density-19 {
  background: rgba(37, 99, 235, 0.80);
  border: 1px solid rgba(37, 99, 235, 0.44);
}
.slot-cell.density-20 {
  background: rgba(30, 58, 138, 0.88);
  border: 1px solid rgba(30, 58, 138, 0.50);
}

/* Tooltip for participant list */
.cell-tooltip {
  position: fixed;
  z-index: 1200;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: none;
  min-width: 160px;
}
.cell-tooltip.is-empty {
  display: none !important;
}
.cell-tooltip .p-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.cell-tooltip .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.cell-tooltip .dot.is-present {
  background: #22c55e;
}
.cell-tooltip .dot.is-absent {
  background: #ef4444;
}
.cell-tooltip .name {
  flex: 1;
}
.cell-tooltip .absent { color: var(--text-muted); }

.slot-cell.is-self-selected {
  border: 1.5px solid rgba(14, 165, 233, 0.7);
  background: rgba(14, 165, 233, 0.08);
}

/* Insight Grid */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.insight-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.best-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.best-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid var(--border);
}

.best-range-item {
  align-items: start;
  flex-direction: column;
}

.best-item strong {
  font-weight: 600;
  font-size: 0.9rem;
}

.best-item span {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: auto;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .meeting-shell {
    grid-template-columns: 1fr;
  }

  .meeting-shell > * {
    min-width: 0;
  }

  .meeting-sidebar {
    position: static;
    width: 100%;
  }

  .meeting-main {
    width: 100%;
  }

  .best-ranges-desktop {
    display: none;
  }

  .availability-grid {
    grid-template-columns: 80px repeat(auto-fit, minmax(70px, 1fr));
  }
}

@media (min-width: 769px) {
  .best-ranges-mobile {
    display: none;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 12px 16px;
  }

  .page-wrap {
    padding: 20px 16px;
  }

  .sidebar-card {
    width: 100%;
    box-sizing: border-box;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .form-card {
    padding: 20px;
  }

  .section-title h2 {
    font-size: 1.1rem;
  }

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

  .time-input-group {
    grid-template-columns: 1fr;
  }

  .calendar-wrapper {
    padding: 12px;
  }

  .day-btn {
    min-height: 32px;
    font-size: 0.82rem;
  }

  .availability-grid {
    grid-template-columns: 70px repeat(auto-fit, minmax(90px, 1fr));
  }

  .grid-corner,
  .time-head,
  .day-head,
  .slot-cell {
    min-height: 14px;
    font-size: 0.68rem;
  }

  .slot-cell {
    height: 100%;
    max-height: 14px;
  }

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

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

  .range-display {
    grid-template-columns: 1fr;
  }

  .range-status {
    text-align: start;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 8px;
    padding: 12px 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .page-wrap {
    padding: 16px 12px;
  }

  .hero-buttons {
    gap: 8px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 12px 20px;
  }

  .form-card {
    padding: 16px;
    border-radius: 12px;
  }

  .form-container {
    padding: 0;
  }

  .calendar-wrapper {
    padding: 10px;
  }

  .day-btn {
    min-height: 30px;
    font-size: 0.78rem;
  }

  .day-btn.is-today {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    box-shadow: inset 0 -2px 0 rgba(37, 99, 235, 0.34);
  }

  .weekday-labels {
    gap: 3px;
    font-size: 0.7rem;
  }

  .day-grid {
    gap: 3px;
  }

  .availability-grid {
    grid-template-columns: 60px repeat(auto-fit, minmax(80px, 1fr));
    min-height: auto;
  }

  .grid-corner,
  .time-head,
  .day-head,
  .slot-cell {
    min-height: 14px;
    font-size: 0.65rem;
    min-width: 44px;
  }

  .slot-cell {
    height: 100%;
    max-height: 14px;
    min-height: unset;
    min-width: unset;
  }

  .meeting-shell {
    gap: 12px;
  }

  .sidebar-card {
    padding: 14px;
  }
}
