/* ============================================================
   یار طب — صفحات مستقل احراز هویت
   وابسته به: tokens.css
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body.auth-page {
  min-height: 100vh;
  margin: 0;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 12% 15%, rgba(37, 99, 235, .14), transparent 28rem),
    radial-gradient(circle at 88% 82%, rgba(79, 70, 229, .12), transparent 26rem),
    var(--bg-body);
  font-family: inherit;
}

.auth-layout {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  align-items: center;
  gap: clamp(32px, 7vw, 112px);
}

/* سمت معرفی برند */
.auth-brand {
  padding: clamp(12px, 3vw, 36px);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 800;
}

.auth-logo__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--text-on-brand);
  background: var(--brand-gradient);
  box-shadow: 0 8px 24px rgba(37, 99, 235, .24);
}

.auth-logo__icon svg {
  width: 24px;
  height: 24px;
}

.auth-brand__badge {
  width: fit-content;
  margin: 64px 0 18px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  border-radius: var(--radius-full);
  font-size: .82rem;
  font-weight: 700;
}

.auth-brand__badge::before {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 4px var(--color-success-bg);
}

.auth-brand__title {
  max-width: 620px;
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(2.1rem, 4.2vw, 4.25rem);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -.04em;
}

.auth-brand__title span {
  color: var(--brand-primary);
}

.auth-brand__description {
  max-width: 550px;
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 2;
}

.auth-points {
  padding: 0;
  margin: 34px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
}

.auth-points li {
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  font-size: .82rem;
  font-weight: 600;
}

.auth-points svg {
  width: 16px;
  height: 16px;
  color: var(--color-success);
}

/* کارت ورود */
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(26px, 4vw, 42px);
  justify-self: end;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
}

.auth-card__eyebrow {
  margin: 0 0 8px;
  color: var(--brand-primary);
  font-size: .85rem;
  font-weight: 800;
}

.auth-card__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.65rem;
  font-weight: 850;
}

.auth-card__description {
  margin: 10px 0 28px;
  color: var(--text-secondary);
  font-size: .92rem;
  line-height: 1.85;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  margin-bottom: 9px;
  display: block;
  color: var(--text-primary);
  font-size: .88rem;
  font-weight: 750;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 21px;
  height: 21px;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 15px;
  outline: none;
  color: var(--text-primary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font: inherit;
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast);
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-input:focus {
  background: var(--bg-surface);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-glow);
}

.auth-input--otp {
  padding: 0 16px;
  direction: ltr;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: .55em;
  text-align: center;
}

.auth-error {
  margin-top: 8px;
  color: var(--color-danger);
  font-size: .8rem;
  font-weight: 600;
}

.auth-button {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--text-on-brand);
  background: var(--brand-gradient);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .23);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              opacity var(--transition-fast);
}

.auth-button:hover {
  box-shadow: 0 11px 24px rgba(37, 99, 235, .3);
  transform: translateY(-2px);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button:focus-visible,
.auth-link:focus-visible,
.auth-logo:focus-visible {
  outline: none;
  box-shadow: var(--shadow-glow);
}

.auth-footer {
  margin: 23px 0 0;
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.9;
  text-align: center;
}

.auth-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 750;
}

.auth-link:hover {
  color: var(--brand-primary-dark);
}

.auth-back {
  margin-top: 22px;
  display: block;
  color: var(--text-secondary);
  font-size: .84rem;
  text-align: center;
}

.auth-messages {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.auth-message {
  padding: 11px 13px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  line-height: 1.7;
}

.auth-message--error {
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border-color: color-mix(in srgb, var(--color-danger) 25%, var(--border-color));
}

.auth-message--success {
  color: var(--color-success);
  background: var(--color-success-bg);
  border-color: color-mix(in srgb, var(--color-success) 25%, var(--border-color));
}

.auth-message--warning {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border-color: color-mix(in srgb, var(--color-warning) 25%, var(--border-color));
}

@media (max-width: 860px) {
  .auth-layout {
    width: min(100%, 560px);
    padding: 20px;
    grid-template-columns: 1fr;
  }

  .auth-brand {
    padding: 8px 4px 0;
    text-align: center;
  }

  .auth-brand__badge {
    margin: 28px auto 15px;
  }

  .auth-brand__title,
  .auth-brand__description {
    max-width: 100%;
  }

  .auth-points {
    justify-content: center;
    margin-top: 24px;
  }

  .auth-card {
    max-width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 480px) {
  .auth-layout {
    padding: 14px;
    gap: 22px;
  }

  .auth-brand__title {
    font-size: 2rem;
  }

  .auth-brand__description {
    font-size: .93rem;
  }

  .auth-points {
    display: none;
  }

  .auth-card {
    padding: 25px 20px;
    border-radius: var(--radius-lg);
  }
}






.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.auth-form-grid .auth-field--full {
  grid-column: 1 / -1;
}

.auth-file-input {
  width: 100%;
  min-height: 52px;
  padding: 9px;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  font: inherit;
}

.auth-file-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-glow);
}

.auth-file-input::file-selector-button {
  padding: 7px 10px;
  margin-left: 10px;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

@media (max-width: 480px) {
  .auth-form-grid {
    grid-template-columns: 1fr;
  }

  .auth-form-grid .auth-field--full {
    grid-column: auto;
  }
}

.auth-optional {
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 500;
}




/* Persian Datepicker — هماهنگ با Design Tokens یار طب */
.datepicker-plot-area {
  color: var(--text-primary);
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: inherit !important;
}

.datepicker-plot-area .datepicker-header {
  color: var(--text-primary) !important;
}

.datepicker-plot-area .datepicker-header .btn-next,
.datepicker-plot-area .datepicker-header .btn-prev {
  color: var(--brand-primary) !important;
}

.datepicker-plot-area .datepicker-day-view .table-days td span,
.datepicker-plot-area .datepicker-month-view .month-item,
.datepicker-plot-area .datepicker-year-view .year-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
}

.datepicker-plot-area .datepicker-day-view .table-days td span:hover,
.datepicker-plot-area .datepicker-month-view .month-item:hover,
.datepicker-plot-area .datepicker-year-view .year-item:hover {
  color: var(--brand-primary) !important;
  background: var(--bg-hover) !important;
}

.datepicker-plot-area .datepicker-day-view .table-days td.selected span,
.datepicker-plot-area .datepicker-month-view .month-item.selected,
.datepicker-plot-area .datepicker-year-view .year-item.selected {
  color: var(--text-on-brand) !important;
  background: var(--brand-gradient) !important;
}

.datepicker-plot-area .toolbox {
  border-top-color: var(--border-color) !important;
}

.datepicker-plot-area .toolbox .btn-today,
.datepicker-plot-area .toolbox .btn-submit {
  color: var(--brand-primary) !important;
}

[data-theme="dark"] .datepicker-plot-area {
  background: var(--bg-surface) !important;
}



.auth-card--wide {
  max-width: 760px;
}

.staff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.auth-button--inline {
  width: auto;
  min-height: 42px;
  padding: 0 16px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.staff-filters {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-button--filter {
  width: auto;
  min-height: 50px;
  margin: 0;
  padding: 0 16px;
}

.staff-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.staff-table {
  width: 100%;
  min-width: 690px;
  border-collapse: collapse;
  font-size: .84rem;
}

.staff-table th,
.staff-table td {
  padding: 13px 12px;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}

.staff-table th {
  color: var(--text-muted);
  background: var(--bg-surface-2);
  font-size: .76rem;
  font-weight: 800;
}

.staff-table tbody tr:last-child td {
  border-bottom: 0;
}

.staff-table tbody tr:hover {
  background: var(--bg-hover);
}

.staff-table strong {
  color: var(--text-primary);
}

.staff-role,
.staff-status {
  padding: 5px 9px;
  display: inline-flex;
  border-radius: var(--radius-full);
  font-size: .73rem;
  font-weight: 750;
}

.staff-role {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}

.staff-status--active {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.staff-status--inactive {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

.staff-status--pending {
  color: var(--color-warning);
  background: var(--color-warning-bg);
}

.staff-action {
  padding: 7px 10px;
  border: 1px solid var(--brand-primary-light);
  border-radius: var(--radius-xs);
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  cursor: pointer;
  font: inherit;
  font-size: .75rem;
  font-weight: 750;
}

.staff-action--danger {
  border-color: color-mix(in srgb, var(--color-danger) 20%, var(--border-color));
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

.staff-empty {
  padding: 28px !important;
  color: var(--text-muted) !important;
  text-align: center !important;
}

@media (max-width: 680px) {
  .staff-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-filters {
    grid-template-columns: 1fr;
  }

  .auth-button--filter {
    width: 100%;
  }
}


.staff-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.staff-avatar {
    flex: 0 0 40px;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
    border: 1px solid var(--border-color, #e2e8f0);
    background-color: var(--bg-surface-2, #f8fafc);
}

.staff-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #94a3b8);
    font-size: 1.25rem;
}





/* ============================================================
   پیش‌نمایش اختصاصی آواتار پروفایل در فرم احراز هویت
   ============================================================ */
.auth-avatar-uploader {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-avatar-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.auth-avatar-img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: center;
  border: 2px solid var(--brand-primary-light);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.auth-avatar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-avatar-badge {
  display: inline-flex;
  width: fit-content;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 750;
}

.auth-avatar-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.auth-file-wrap {
  width: 100%;
}
