/* ============================================================
   Deploy — hosting provider picker, setup steps, auto-deploy
   ============================================================ */

.deploy-config {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  background: var(--bg);
  margin-bottom: var(--sp-4);
}

.deploy-config .field:last-child {
  margin-bottom: 0;
}

/* ---------- Provider setup form (horizontal wizard) ---------- */

.provider-form {
  margin-top: 0;
}

.provider-form .field {
  margin: 0;
}

.setup-wizard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Step track: numbered dots + labels joined by hairlines */
.setup-wizard-track {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.setup-wizard-node {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  cursor: default;
  flex-shrink: 0;
}

.setup-wizard-node.is-reachable {
  cursor: pointer;
}

.setup-wizard-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.setup-wizard-dot .icon {
  color: inherit;
}

.setup-wizard-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-4);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color var(--t-fast);
}

.setup-wizard-node.is-current .setup-wizard-dot {
  border-color: var(--ink);
  color: var(--ink);
}

.setup-wizard-node.is-current .setup-wizard-label {
  color: var(--ink);
  font-weight: 600;
}

.setup-wizard-node.is-done .setup-wizard-dot {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.setup-wizard-node.is-done .setup-wizard-label {
  color: var(--ink-2);
}

.setup-wizard-node.is-reachable:hover .setup-wizard-label {
  color: var(--ink);
}

.setup-wizard-line {
  flex: 1;
  height: 1px;
  min-width: var(--sp-3);
  background: var(--border);
  transition: background var(--t-fast);
}

.setup-wizard-line.is-done {
  background: var(--ink-3);
}

/* Panel: one focused step at a time */
.setup-wizard-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: var(--sp-4);
}

.setup-wizard-panel.is-entering {
  animation: setup-panel-in 0.22s ease both;
}

@keyframes setup-panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.setup-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 1.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .setup-wizard-panel.is-entering {
    animation: none;
  }
}

.provider-step-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.provider-step-hint {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--ink-4);
}

.provider-step-hint:empty {
  display: none;
}

/* ---------- Auto-deploy yes / no choice ---------- */

.deploy-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

@media (max-width: 520px) {
  .deploy-choice {
    grid-template-columns: 1fr;
  }
}

.deploy-choice-option {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.deploy-choice-option:hover {
  border-color: var(--border-strong);
}

.deploy-choice-option.is-selected {
  border-color: var(--ink);
  background: var(--surface);
}

.deploy-choice-input {
  flex-shrink: 0;
  margin: 0.2rem 0 0;
  accent-color: var(--ink);
}

.deploy-choice-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.deploy-choice-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}

.deploy-choice-label {
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.deploy-choice-hint {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--ink-4);
}

.deploy-choice-rec {
  flex-shrink: 0;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill, 999px);
  background: var(--primary-softer);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Token guides ---------- */

.provider-token-guide {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.provider-token-guide-lead {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--ink-3);
}

/* Numbered how-to for API-token providers */
.provider-guide-steps {
  margin: 0;
  padding: 0 0 0 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--ink-3);
}

.provider-guide-steps li::marker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ink-4);
}

.provider-guide-link {
  align-self: flex-start;
}

/* Firebase CLI guide (command paths) */
.provider-token-path {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.provider-token-path--primary {
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.provider-token-path-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.provider-token-path-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill, 999px);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.provider-token-path-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.provider-token-path-hint {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--ink-4);
}

.provider-token-path-foot {
  margin: 0;
}

.provider-token-path-link {
  font-size: var(--text-xs);
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.provider-token-path-link:hover {
  color: var(--ink);
}

.provider-token-install {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-2);
}

.provider-token-install-summary {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.provider-token-install-summary::-webkit-details-marker {
  display: none;
}

.provider-token-install-summary::before {
  content: '›';
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform var(--t-fast);
}

.provider-token-install[open] .provider-token-install-summary::before {
  transform: rotate(90deg);
}

.provider-token-install[open] .provider-token-install-summary {
  color: var(--ink);
  margin-bottom: var(--sp-3);
}

/* ---------- Copyable commands / snippets ---------- */

.guide-code {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--code-bg);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--code-line);
}

.guide-code code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--code-ink);
  overflow-x: auto;
  white-space: nowrap;
}

.guide-code--block {
  align-items: flex-start;
}

.guide-code--block pre {
  flex: 1;
  margin: 0;
  overflow-x: auto;
}

.guide-code--block code {
  white-space: pre;
}

.guide-code .code-copy {
  color: var(--ink-4);
  padding: 2px 6px;
}

.guide-code .code-copy:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Provider detail fields (IDs, site names, …) ---------- */

.provider-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 560px) {
  .provider-fields {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  }
}

.provider-field {
  margin: 0;
  min-width: 0;
}

.provider-field-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}

.provider-field-optional {
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* eddy.json confirmation (custom script provider) */
.provider-confirm {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.provider-confirm-input {
  margin: 0;
  accent-color: var(--ink);
}

/* ---------- Modal header brand ---------- */

.modal-title--custom {
  display: flex;
  align-items: center;
  min-height: 1.75rem;
}

/* ---------- Hosting provider picker ---------- */

.hosting-picker-hint {
  display: block;
  margin-bottom: var(--sp-3);
}

.hosting-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

@media (min-width: 560px) {
  .hosting-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hosting-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  cursor: pointer;
  min-height: clamp(4.75rem, 14vw, 6rem);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.hosting-tile:hover:not(.is-disabled) {
  border-color: var(--border-strong);
}

.hosting-tile.is-selected {
  border-color: var(--ink);
  background: var(--primary-softer);
  box-shadow: 0 0 0 1px var(--ink);
}

.hosting-tile.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hosting-tile-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hosting-tile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hosting-tile-logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: clamp(2.25rem, 9vw, 3.35rem);
  object-fit: contain;
}

.hosting-tile--firebase .hosting-tile-logo img,
.hosting-tile--vercel .hosting-tile-logo img,
.hosting-tile--cloudflare .hosting-tile-logo img,
.hosting-tile--netlify .hosting-tile-logo img,
.hosting-tile--railway .hosting-tile-logo img {
  height: clamp(2.35rem, 9vw, 3.5rem);
  width: auto;
  max-width: 96%;
  max-height: none;
}

.hosting-tile--custom .hosting-tile-logo img {
  width: min(94%, 11.5rem);
  max-width: 94%;
  max-height: clamp(2.1rem, 8vw, 3rem);
}

.hosting-tile-wordmark {
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-3);
}

.hosting-tile-soon {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  pointer-events: none;
}

.deploy-provider-config {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

.deploy-provider-config:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

/* ---------- Firebase project picker (reuses repo-picker shell) ---------- */

.provider-form .firebase-project-picker .repo-picker-list,
.modal-body .firebase-project-picker .repo-picker-list {
  max-height: min(9.5rem, 32vh);
}

.firebase-project-picker-status {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
}

.firebase-project-picker-option {
  align-items: flex-start;
}

.firebase-project-picker-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.firebase-project-picker-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
}

.firebase-project-picker-option-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firebase-project-picker-badge {
  flex-shrink: 0;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.firebase-project-picker-badge--ok {
  background: var(--primary-softer);
  color: var(--ink-2);
}

.firebase-project-picker-badge--muted {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-4);
}

.firebase-project-picker-option.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.firebase-project-picker-option.is-disabled:hover {
  background: transparent;
}

.firebase-project-picker-option.is-disabled.is-selected {
  background: var(--surface);
}

.firebase-project-picker-option-id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
}

.modal-body:has(.firebase-project-picker.is-open) {
  overflow: visible;
}

.deploy-modal-content:has(.firebase-project-picker.is-open),
.setup-wizard-panel:has(.firebase-project-picker.is-open),
.provider-step-body:has(.firebase-project-picker.is-open) {
  overflow: visible;
}

.firebase-project-picker.is-open .repo-picker-menu {
  z-index: 50;
}
