/* ============================================================
   Cirrus8 Dev Box Selector — styles
   ============================================================ */

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

:root {
  --c-brand:       #0f7fbd;
  --c-brand-dark:  #0a5f8f;
  --c-brand-light: #e6f4fb;
  --c-teal:        #0ea99b;
  --c-teal-light:  #e6f7f6;
  --c-bg:          #f4f7fa;
  --c-surface:     #ffffff;
  --c-border:      #dde4ec;
  --c-text:        #1a2230;
  --c-text-muted:  #6b7a90;
  --c-success:     #1a9e6e;
  --c-success-bg:  #e6f7f1;
  --c-selected:    #0f7fbd;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow-card:   0 2px 8px rgba(15, 127, 189, 0.08);
  --shadow-hover:  0 6px 20px rgba(15, 127, 189, 0.18);
  --transition:    0.18s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---- Layout ---- */

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ---- Header ---- */

.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 0 20px;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  color: var(--c-brand);
  letter-spacing: -0.02em;
}

.logo-icon {
  font-size: 1.4rem;
}

.logo-text {
  font-weight: 500;
  color: var(--c-text);
}

.logo-text strong {
  color: var(--c-brand);
}

.header-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ---- Hero ---- */

.hero {
  margin-bottom: 28px;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--c-text-muted);
  max-width: 560px;
}

.hero-subtitle code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.88em;
  background: var(--c-brand-light);
  color: var(--c-brand-dark);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---- Environment Grid ---- */

.env-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.env-card {
  position: relative;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
}

.env-card:hover {
  border-color: var(--c-brand);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.env-card:focus-visible {
  outline: 3px solid var(--c-brand);
  outline-offset: 2px;
}

.env-card.selected {
  border-color: var(--c-selected);
  background: var(--c-brand-light);
  box-shadow: var(--shadow-hover);
}

.env-card.ucit.selected {
  border-color: var(--c-teal);
  background: var(--c-teal-light);
}

.env-icon {
  font-size: 1.1rem;
  color: var(--c-brand);
  line-height: 1;
}

.env-card.ucit .env-icon {
  color: var(--c-teal);
}

.env-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}

.env-desc {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  line-height: 1.4;
}

/* Badges */
.env-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 20px;
  padding: 2px 9px;
  margin-top: 4px;
  align-self: flex-start;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.badge-default {
  background: var(--c-teal-light);
  color: var(--c-teal);
}

.badge-dev {
  background: var(--c-brand-light);
  color: var(--c-brand-dark);
}

.env-card.selected .badge-dev {
  background: var(--c-brand);
  color: #fff;
}

.env-card.selected .badge-default {
  background: var(--c-teal);
  color: #fff;
}

/* Selected checkmark */
.env-card.selected::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-brand);
  background: var(--c-surface);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--c-brand);
}

.env-card.ucit.selected::after {
  color: var(--c-teal);
  border-color: var(--c-teal);
}

/* ---- Confirmation Bar ---- */

.confirmation-bar {
  background: var(--c-success-bg);
  border: 1px solid #a3dfc9;
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 24px;
  animation: slideIn 0.22s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.confirmation-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.confirmation-icon {
  font-size: 1.1rem;
  color: var(--c-success);
  font-weight: 700;
}

.confirmation-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-success);
  flex: 1;
  min-width: 180px;
}

.btn-login {
  display: inline-block;
  background: var(--c-brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-login:hover {
  background: var(--c-brand-dark);
}

/* ---- Diagnostics Panel ---- */

.diagnostics-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.diag-header {
  margin-bottom: 14px;
}

.diag-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.diag-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.diag-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.875rem;
}

.diag-label {
  color: var(--c-text-muted);
  min-width: 120px;
  flex-shrink: 0;
}

.diag-value {
  color: var(--c-text);
  font-weight: 500;
}

.diag-value.mono {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.83rem;
  background: var(--c-bg);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
}

.btn-reset {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--c-text-muted);
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.btn-reset:hover {
  color: var(--c-text);
  border-color: var(--c-brand);
  background: var(--c-brand-light);
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--c-border);
  padding: 16px 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--c-text-muted);
  background: var(--c-surface);
}

/* ---- Responsive ---- */

@media (max-width: 500px) {
  .hero-title {
    font-size: 1.4rem;
  }

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

  .diag-row {
    flex-direction: column;
    gap: 2px;
  }

  .diag-label {
    min-width: unset;
    font-size: 0.78rem;
  }
}

@media (max-width: 360px) {
  .env-grid {
    grid-template-columns: 1fr;
  }
}
