/* ==========================================================================
   Служебные стили для API.DIGOOD.RU (Простая светлая тема)
   ========================================================================== */

:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;

  --border-light: #e2e8f0;
  --border-focus: #4f46e5;
  --border-subtle: #edf2f7;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent-primary: #4f46e5;       /* clean indigo */
  --accent-hover: #4338ca;
  --accent-light: #eef2ff;
  --accent-border: #c7d2fe;

  --status-online: #10b981;
  --status-online-bg: #ecfdf5;
  --status-online-border: #a7f3d0;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
}

/* Сброс */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body.light-theme {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Страница входа (Auth Page)
   ========================================================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  box-shadow: 0 0 6px rgba(79, 70, 229, 0.4);
  animation: pulse-dot 2.5s infinite;
}

.dot-live {
  background-color: var(--status-online);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

.env-tag {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.card-hero {
  margin-bottom: 24px;
}

.domain-title {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.domain-subtitle {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.notice-box {
  display: flex;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 3.5px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
}

.notice-icon {
  flex-shrink: 0;
  color: var(--accent-primary);
  margin-top: 2px;
}

.notice-text {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Ошибка */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Форма */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.label-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 11px 40px 11px 38px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.toggle-password:hover {
  color: var(--text-primary);
}

.toggle-password .hidden {
  display: none;
}

/* Кнопка отправки */
.submit-btn {
  margin-top: 6px;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.submit-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   Страница приветствия (Welcome Page)
   ========================================================================== */

.dashboard-header {
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
  padding: 14px 24px;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-env {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--status-online);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.welcome-container {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 20px 40px;
}

.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--status-online-bg);
  border: 1px solid var(--status-online-border);
  color: #047857;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.welcome-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.status-banner {
  margin-top: 28px;
  display: flex;
  gap: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.status-banner-icon {
  flex-shrink: 0;
  color: var(--accent-primary);
  margin-top: 2px;
}

.status-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.status-banner-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.telemetry-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.telemetry-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.telemetry-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.telemetry-val.mono {
  font-family: var(--font-mono);
}

.telemetry-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.welcome-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.btn-danger:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* Адаптивность */
@media (max-width: 640px) {
  .auth-card {
    padding: 24px 20px;
  }

  .domain-title {
    font-size: 20px;
  }

  .welcome-card {
    padding: 24px 18px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-user {
    width: 100%;
    justify-content: space-between;
  }
}
