/* frontend/src/index.css */
:root {
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #fff;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #aa3bff;
  --accent-bg: rgba(170, 59, 255, 0.1);
  --accent-border: rgba(170, 59, 255, 0.5);
  --social-bg: rgba(244, 243, 236, 0.5);
  --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
  --sans:
    system-ui,
    "Segoe UI",
    Roboto,
    sans-serif;
  --heading:
    system-ui,
    "Segoe UI",
    Roboto,
    sans-serif;
  --mono:
    ui-monospace,
    Consolas,
    monospace;
  font: 18px/145% var(--sans);
  letter-spacing: 0.18px;
  color-scheme: light;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  @media (max-width: 1024px) {
    font-size: 16px;
  }
}
#root {
  width: 1126px;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  border-inline: 1px solid var(--border);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2 {
  font-family: var(--heading);
  font-weight: 500;
  color: var(--text-h);
}
h1 {
  font-size: 56px;
  letter-spacing: -1.68px;
  margin: 32px 0;
  @media (max-width: 1024px) {
    font-size: 36px;
    margin: 20px 0;
  }
}
h2 {
  font-size: 24px;
  line-height: 118%;
  letter-spacing: -0.24px;
  margin: 0 0 8px;
  @media (max-width: 1024px) {
    font-size: 20px;
  }
}
p {
  margin: 0;
}
code,
.counter {
  font-family: var(--mono);
  display: inline-flex;
  border-radius: 4px;
  color: var(--text-h);
}
code {
  font-size: 15px;
  line-height: 135%;
  padding: 4px 8px;
  background: var(--code-bg);
}

/* frontend/src/pages/Login.css */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 1rem;
}
.login-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.login-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
}
.login-sub {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-top: 0.5rem;
}
input {
  padding: 0.6rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #1e293b;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}
input:focus {
  border-color: #6366f1;
}
input::placeholder {
  color: #94a3b8;
}
.login-error {
  color: #dc2626;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}
.login-pending {
  color: #d97706;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}
form button[type=submit] {
  margin-top: 1.25rem;
  padding: 0.65rem;
  background: #6366f1;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
form button[type=submit]:hover:not(:disabled) {
  background: #4f46e5;
}
form button[type=submit]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-toggle {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}
.login-toggle button {
  background: none;
  border: none;
  color: #6366f1;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  color: #94a3b8;
  font-size: 0.8rem;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.login-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  color: #1e293b;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.login-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.login-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* frontend/src/App.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: system-ui, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
}
.instances-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.instances-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}
.instances-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}
.instances-user button {
  background: none;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: border-color 0.15s, color 0.15s;
}
.instances-user button:hover {
  border-color: #6366f1;
  color: #1e293b;
}
h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
}
.state-msg {
  color: #64748b;
  margin-top: 1rem;
}
.state-msg.error {
  color: #dc2626;
}
.instances-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.instances-table th,
.instances-table td {
  padding: 0.85rem 1.1rem;
  text-align: left;
}
.instances-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.instances-table td {
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.92rem;
}
.instances-table tbody tr:last-child td {
  border-bottom: none;
}
.instances-table tbody tr:hover {
  background: #f8fafc;
}
.instances-table code {
  font-family: monospace;
  font-size: 0.82rem;
  color: #64748b;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge.running {
  background: #dcfce7;
  color: #15803d;
}
.badge.stopped {
  background: #f1f5f9;
  color: #64748b;
}
.badge.env-prod {
  background: #fee2e2;
  color: #dc2626;
}
.badge.env-staging {
  background: #fef9c3;
  color: #a16207;
}
.badge.env-dev {
  background: #dbeafe;
  color: #1d4ed8;
}
.instances-user a {
  font-size: 0.82rem;
  color: #475569;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.instances-user a:hover {
  border-color: #6366f1;
  color: #1e293b;
}
.cluster-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.cluster-form input {
  padding: 0.5rem 0.85rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #1e293b;
  font-size: 0.9rem;
  outline: none;
  flex: 1;
  min-width: 120px;
}
.cluster-form input:focus {
  border-color: #6366f1;
}
.cluster-form button {
  padding: 0.5rem 1.1rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cluster-form button:hover:not(:disabled) {
  background: #4f46e5;
}
.cluster-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.badge.cluster-ready {
  background: #dcfce7;
  color: #15803d;
}
.badge.cluster-pending {
  background: #fef9c3;
  color: #a16207;
}
.badge.cluster-failed {
  background: #fee2e2;
  color: #dc2626;
}
.badge.orchestrator-ready {
  background: #dcfce7;
  color: #15803d;
}
.badge.orchestrator-pending {
  background: #fef9c3;
  color: #a16207;
}
.badge.orchestrator-failed {
  background: #fee2e2;
  color: #dc2626;
}
.detail-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.detail-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  gap: 1rem;
}
.detail-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-right: 0.75rem;
}
.detail-external-link {
  font-size: 0.85rem;
  color: #6366f1;
  text-decoration: none;
  white-space: nowrap;
}
.detail-external-link:hover {
  text-decoration: underline;
}
.detail-section {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}
.detail-section:last-child {
  border-bottom: none;
}
.detail-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}
.detail-section .instances-table {
  box-shadow: none;
  border: 1px solid #e2e8f0;
}
.detail-label {
  color: #64748b;
  font-size: 0.85rem;
  width: 8rem;
}
.action-select {
  padding: 0.2rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #475569;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.action-select:hover {
  border-color: #6366f1;
}
.retry-btn {
  background: none;
  border: 1px solid #fde68a;
  color: #a16207;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.retry-btn:hover {
  background: #fef9c3;
}
.muted {
  color: #94a3b8;
}
.delete-btn {
  background: none;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}
.delete-btn:hover {
  background: #fee2e2;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #64748b;
  cursor: pointer;
}
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  background: #cbd5e1;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle.on {
  background: #6366f1;
}
.toggle.on::after {
  transform: translateX(16px);
  background: #fff;
}
.toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
