/* homelab-auth — modern responsive UI */

:root {
  --color-bg: #07111f;
  --color-bg-elevated: rgba(10, 19, 34, 0.82);
  --color-surface: rgba(12, 21, 37, 0.78);
  --color-surface-strong: rgba(16, 28, 48, 0.92);
  --color-surface-soft: rgba(255, 255, 255, 0.04);
  --color-border: rgba(148, 163, 184, 0.16);
  --color-border-strong: rgba(96, 165, 250, 0.28);
  --color-text: #e6eef8;
  --color-text-muted: #97a8c0;
  --color-accent: #7dd3fc;
  --color-accent-strong: #38bdf8;
  --color-accent-soft: rgba(56, 189, 248, 0.16);
  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-danger: #fb7185;
  --radius-xs: 12px;
  --radius-sm: 16px;
  --radius: 24px;
  --radius-lg: 32px;
  --shadow-soft: 0 20px 60px rgba(2, 8, 23, 0.3);
  --shadow-card: 0 24px 80px rgba(2, 8, 23, 0.42);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", monospace;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.16), transparent 28%),
    radial-gradient(circle at bottom center, rgba(16, 185, 129, 0.12), transparent 26%),
    linear-gradient(180deg, #08101d 0%, #0a1423 48%, #07111f 100%);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.page-wrapper {
  position: relative;
  min-height: 100dvh;
}

.page-content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.page-content-auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-content-dashboard {
  padding-top: 24px;
}

.auth-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 480px);
  gap: 28px;
  align-items: stretch;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(14, 24, 40, 0.74), rgba(8, 16, 29, 0.52));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 70%);
  pointer-events: none;
}

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(13, 22, 38, 0.88), rgba(8, 15, 28, 0.84));
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(22px);
  padding: 28px;
}

.card-wide {
  width: 100%;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  align-items: end;
}

.dashboard-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #7dd3fc 0%, #818cf8 52%, #c084fc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 12px 30px rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 28px;
  height: 28px;
  fill: #08101d;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.hero-panel .brand,
.auth-card .brand {
  margin-bottom: 8px;
}

.center-card .brand {
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: var(--color-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title,
.page-title {
  font-size: clamp(1.9rem, 4vw, 3.6rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.page-title {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 10px;
}

.page-title-left {
  text-align: left;
}

.hero-copy,
.page-subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
}

.page-subtitle {
  text-align: center;
  margin-bottom: 24px;
}

.page-subtitle-left {
  text-align: left;
  margin-bottom: 0;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #d7e4f4;
  font-size: 0.9rem;
}

.hero-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7dd3fc, #818cf8);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.08);
}

.info-banner {
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(59, 130, 246, 0.09);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: #c2d5ec;
}

.info-banner strong {
  color: var(--color-accent);
}

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.section-count {
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #c2d5ec;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.form-input::placeholder {
  color: #7f91ab;
}

.form-input:hover {
  background: rgba(255, 255, 255, 0.055);
}

.form-input:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.65);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  width: 100%;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 680;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 50%, #60a5fa 100%);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.22);
}

.btn-secondary {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.btn-ghost {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.btn-ghost-danger {
  color: var(--color-danger);
}

.btn-inline {
  width: auto;
  min-width: 140px;
}

.btn-center {
  width: auto;
  margin: 0 auto;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-action-group {
  min-width: 200px;
}

.status-message {
  margin-top: 16px;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  white-space: pre-line;
}

.status-info {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.2);
  color: var(--color-accent);
}

.status-success {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.2);
  color: var(--color-success);
}

.status-warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.2);
  color: var(--color-warning);
}

.status-error {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.2);
  color: var(--color-danger);
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 20px;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.16);
}

.section-divider span {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.badge-active {
  background: rgba(74, 222, 128, 0.12);
  color: var(--color-success);
}

.badge-active::before {
  background: var(--color-success);
}

.badge-disabled {
  background: rgba(251, 113, 133, 0.12);
  color: var(--color-danger);
}

.badge-disabled::before {
  background: var(--color-danger);
}

.badge-admin {
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-accent);
}

.badge-admin::before {
  background: var(--color-accent);
}

.badge-info {
  background: rgba(148, 163, 184, 0.12);
  color: #c1d0e3;
}

.badge-info::before {
  background: #c1d0e3;
}

.badge-warning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--color-warning);
}

.badge-warning::before {
  background: var(--color-warning);
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 16, 29, 0.72);
  backdrop-filter: blur(18px);
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.header-user strong {
  color: var(--color-text);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-inline .form-input {
  flex: 1 1 220px;
}

.invite-display {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.invite-display-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.invite-link {
  display: block;
  color: var(--color-accent);
  text-decoration: none;
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.invite-link:hover {
  text-decoration: underline;
}

.invite-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.invite-note {
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

thead th {
  padding: 14px 16px;
  text-align: left;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

tbody td {
  padding: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.table-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 28px;
}

.user-name {
  font-weight: 650;
}

.user-meta,
.table-muted {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.table-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.table-nowrap {
  white-space: nowrap;
}

.status-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  color: var(--color-accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.16);
}

.center-card {
  text-align: center;
}

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

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

.text-small {
  font-size: 0.84rem;
}

.auth-card .text-small {
  display: block;
  margin-bottom: 18px;
}

.mt-4 {
  margin-top: 16px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.24);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 980px) {
  .auth-shell,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-content {
    padding: 20px 14px 28px;
  }

  .hero-panel,
  .card {
    padding: 22px;
    border-radius: 22px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

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

  .section-head,
  .invite-display-head,
  .invite-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-center,
  .header-user {
    width: 100%;
    justify-content: center;
  }

  .table-action-group {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .page-content-auth {
    align-items: stretch;
  }

  .hero-panel {
    gap: 16px;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
  }

  .brand-icon svg {
    width: 24px;
    height: 24px;
  }

  .hero-copy,
  .page-subtitle,
  .section-description {
    font-size: 0.95rem;
  }

  .btn-group,
  .form-inline {
    flex-direction: column;
  }

  .btn-inline,
  .btn-ghost {
    width: 100%;
  }
}
