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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  max-width: 480px;
  width: 100%;
  padding: 2rem;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

h1 span { color: #f97316; }

.subtitle {
  color: #888;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

form { display: flex; flex-direction: column; gap: 1rem; }

label {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 0.25rem;
  display: block;
}

input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus { border-color: #f97316; }

.slug-preview {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.25rem;
}

.slug-preview span { color: #f97316; }

button {
  padding: 0.75rem 1.5rem;
  background: #f97316;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

button:hover { background: #fb923c; }
button:disabled { background: #444; color: #888; cursor: not-allowed; }

.status {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.status.info { display: block; background: #1a1a2e; border: 1px solid #333; }
.status.success { display: block; background: #0a2a0a; border: 1px solid #2d5a2d; color: #6fcf6f; }
.status.error { display: block; background: #2a0a0a; border: 1px solid #5a2d2d; color: #cf6f6f; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #444;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bar */
.progress-bar {
  margin-top: 1rem;
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #f97316;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

/* Pairing code input */
.code-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.code-input-row input {
  flex: 1;
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  text-align: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.code-input-row button {
  flex-shrink: 0;
  margin-top: 0;
}

/* Pairing page */
.token-box {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #f97316;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: #333;
  color: #ccc;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.copy-btn:hover { background: #444; }

.warning {
  background: #2a2a0a;
  border: 1px solid #5a5a2d;
  color: #cfcf6f;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* [hydra] verification phase styles */
.phase-hint {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 1rem;
}

.phase-hint strong { color: #f97316; }

.resend-row {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.resend-timer {
  color: #555;
  font-size: 0.75rem;
}

.link-btn {
  background: none;
  border: none;
  color: #f97316;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.link-btn:hover { color: #fb923c; }
.link-btn:disabled { color: #555; cursor: not-allowed; text-decoration: none; }

.back-link {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.session-info {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-info strong { color: #f97316; }

/* [hydra] tab bar — browser-style instance tabs */
.tab-bar {
  display: flex;
  gap: 0;
  align-items: flex-end;
  border-bottom: 1px solid #333;
  margin-bottom: 0;
  padding-left: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  padding: 0.5rem 1rem;
  background: #141414;
  color: #888;
  border: 1px solid #333;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: -1px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  font-family: inherit;
  margin-top: 0;
}

.tab:hover { background: #1a1a1a; color: #ccc; }

.tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #444;
  z-index: 1;
  margin-bottom: -1px;
  padding-bottom: calc(0.5rem + 1px);
}

/* Status dot inside tab */
.tab-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tab-dot.paired      { background: #22c55e; }
.tab-dot.unpaired    { background: #eab308; }
.tab-dot.provisioning {
  background: #f97316;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.tab-dot.stopped     { background: #666; }
.tab-dot.failed      { background: #ef4444; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* "+" add tab */
.tab-add {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: #666;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
}

.tab-add:hover { color: #f97316; background: transparent; }

.tab-add.active {
  color: #f97316;
  background: #1a1a1a;
  border-color: #444;
  border-bottom: none;
}

/* [hydra] full-viewport dashboard (Phase 3) */
.dashboard-fullscreen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}

.dashboard-brand {
  font-size: 1.2rem;
  margin-bottom: 0;
}

.dashboard-session {
  font-size: 0.8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-session strong { color: #f97316; }

/* Dashboard content area — fills remaining viewport */
.dashboard-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.dashboard-content iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #0a0a0a;
}

/* Create / provisioning panels centered in content area */
.create-panel {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0a0a0a;
}

.create-panel-inner {
  max-width: 480px;
  width: 100%;
  padding: 2rem;
}

/* Provisioning progress inside centered panel */
.tab-provision-status {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 0.5rem;
}

.tab-progress-bar {
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.tab-progress-fill {
  height: 100%;
  background: #f97316;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

.btn-small {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-small:not(.btn-outline):not(.btn-success) {
  background: #f97316;
  color: #000;
}

.btn-small:not(.btn-outline):not(.btn-success):hover { background: #fb923c; }

.btn-outline {
  background: transparent;
  color: #f97316;
  border: 1px solid #f97316;
}

.btn-outline:hover { background: #f9731610; }
.btn-outline:disabled { color: #666; border-color: #333; cursor: wait; }

.btn-success {
  background: #166534;
  color: #6fcf6f;
}
