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

@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg: #0a0e17;
  --surface: #121826;
  --surface-alt: #1a2234;
  --border: #222d42;
  --border-focus: #10b981;
  --text: #f9fafb;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #059669;
  --primary-hover: #10b981;
  --primary-active: #047857;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 1.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow);
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo {
  height: 48px;
  margin-bottom: 1rem;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.brand-subtitle {
  font-size: 0.925rem;
  color: var(--text-muted);
}

.client-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.client-badge img {
  height: 18px;
  width: 18px;
  border-radius: 50%;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  font-family: inherit;
  font-size: 1.05rem;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  direction: ltr;
  text-align: right;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-input.otp-input {
  letter-spacing: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  direction: ltr;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:active {
  background-color: var(--primary-active);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--surface-alt);
  color: var(--text);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary-hover);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.btn-text:hover {
  text-decoration: underline;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-danger {
  background-color: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background-color: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.phone-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
}

.phone-badge-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  direction: rtl;
}

.timer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.825rem;
  color: var(--text-dim);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

/* Account Dashboard */
.account-card {
  width: 100%;
  max-width: 680px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow);
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.session-device {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.session-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-current {
  background-color: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Services Grid & Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.85rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.service-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.service-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
}

.service-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.service-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.service-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.service-status {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.725rem;
  font-weight: 600;
}

.service-status.active {
  background-color: var(--success-bg);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.service-status.ready {
  background-color: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.service-action {
  height: 38px;
  font-size: 0.875rem;
  border-radius: 6px;
}

