/* ==========================================================================
   Служебные стили для заглушек 3-го уровня (DIGOOD.RU)
   ========================================================================== */

:root {
  --bg-primary: #090c10;
  --bg-secondary: #0d1117;
  --bg-card: #131720;
  --bg-card-hover: #171d28;
  --bg-input: #0a0d13;
  --border-subtle: #21262d;
  --border-focus: #384252;
  
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #484f58;

  --accent-dynamic: #3b82f6; /* динамически задаётся из PHP для каждого домена */
  --accent-glow: rgba(59, 130, 246, 0.15);

  --status-online: #10b981;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.25);

  --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: 16px;
  
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* Сброс и базовые настройки */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Фоновая технологичная сетка */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* Мягкое свечение */
.glow-orb {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

.welcome-glow {
  top: 15%;
  width: 800px;
  height: 500px;
}

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

.auth-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
  position: relative;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s ease;
}

.auth-card:hover {
  border-color: var(--border-focus);
}

/* Заголовочная часть карточки */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-dynamic);
  box-shadow: 0 0 8px var(--accent-dynamic);
  animation: pulse-dot 2.5s infinite;
}

.dot-live {
  background-color: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}

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

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

/* Hero блок с текстом */
.card-hero {
  margin-bottom: 24px;
}

.domain-title {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  margin-bottom: 6px;
}

.domain-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

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

.notice-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #c9d1d9;
}

/* Сообщения об ошибках */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  animation: shake 0.4s ease-in-out;
}

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

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

/* Форма входа */
.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: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.label-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  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 var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 40px 11px 38px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-dynamic);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #0e121a;
}

.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-main);
}

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

/* Кнопка входа */
.submit-btn {
  margin-top: 8px;
  background: var(--accent-dynamic);
  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.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

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

/* Информационный подвал карточки */
.card-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.meta-item {
  display: flex;
  gap: 4px;
}

.meta-value {
  color: var(--text-muted);
}

/* Переключатель для быстрого тестирования */
.preview-switch {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.switch-title {
  color: var(--text-dim);
}

.switch-link {
  color: var(--text-muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  transition: all 0.15s ease;
}

.switch-link:hover, .switch-link.active {
  color: #ffffff;
  border-color: var(--accent-dynamic);
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Вторая страница: Приветствие / Dashboard (Welcome Page)
   ========================================================================== */

.dashboard-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  padding: 14px 24px;
}

.header-inner {
  max-width: 1000px;
  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: #ffffff;
}

.badge-env {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  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: #ffffff;
}

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

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  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: #fca5a5;
}

.welcome-container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px 40px;
}

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

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.welcome-title {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

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

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

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

.status-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.status-banner-text {
  font-size: 13px;
  color: var(--text-muted);
  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: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  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: #ffffff;
  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-subtle);
}

.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: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
}

/* ==========================================================================
   Адаптивность (Mobile Friendly)
   ========================================================================== */

@media (max-width: 640px) {
  .auth-card {
    padding: 24px 20px;
  }

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

  .card-footer {
    flex-direction: column;
    gap: 8px;
  }

  .preview-switch {
    flex-wrap: wrap;
    justify-content: center;
  }

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

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

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