/* ── ekai Brand Tokens ── */
:root {
  --ekai-orange: #F37640;
  --ekai-orange-hover: #e0632f;
  --ekai-teal: #54A4A0;
  --ekai-teal-light: #E4F1F1;
  --ekai-neutral-warm: #F9F5F0;
  --ekai-dark: #2C2321;
  --ekai-text: #333;
  --ekai-text-muted: #666;
  --ekai-border: #e0dcd8;
  --ekai-bg: #F9F5F0;
  --ekai-white: #fff;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--ekai-bg);
  color: var(--ekai-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Header / Logo Bar ── */

.header {
  width: 100%;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ekai-white);
  border-bottom: 1px solid var(--ekai-border);
}

.header img {
  height: 28px;
  width: auto;
}

/* ── Layout ── */

.page-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 2rem 1rem;
}

.container {
  background: var(--ekai-white);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(44, 35, 33, 0.06), 0 8px 24px rgba(44, 35, 33, 0.08);
  width: 100%;
  max-width: 520px;
}

/* ── Progress indicator ── */

.progress {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ekai-border);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.progress-dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--ekai-border);
  color: #aaa;
  background: var(--ekai-white);
  transition: all 0.25s ease;
}

.progress-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #aaa;
  transition: color 0.25s ease;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--ekai-border);
  margin: 0 0.5rem;
  margin-bottom: 1.25rem;
  transition: background 0.25s ease;
}

.progress-line-help,
.progress-step-help {
  display: none !important;
}

.progress-line-help.visible {
  display: block !important;
}

.progress-step-help.visible {
  display: flex !important;
}

.progress-step.active .progress-dot {
  border-color: var(--ekai-orange);
  background: var(--ekai-orange);
  color: #fff;
}

.progress-step.active .progress-label {
  color: var(--ekai-orange);
}

.progress-step.completed .progress-dot {
  border-color: var(--ekai-teal);
  background: var(--ekai-teal-light);
  color: var(--ekai-teal);
}

.progress-step.completed .progress-label {
  color: var(--ekai-teal);
}

.progress-step.completed + .progress-line {
  background: var(--ekai-teal);
}

/* ── Error ── */

.error {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: #fef2ee;
  border: 1px solid #f5c6b0;
  border-left: 3px solid var(--ekai-orange);
  border-radius: var(--radius-sm);
  color: #b93a14;
  font-size: 0.9rem;
}

/* ── Step panels ── */

.step-panel h1 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ekai-dark);
}

.step-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ekai-dark);
}

.step-panel h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ekai-dark);
}

.step-panel p,
.step-panel ul,
.step-panel ol {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ekai-text-muted);
}

.step-panel ul,
.step-panel ol {
  padding-left: 1.25rem;
}

.step-panel li {
  margin-bottom: 0.35rem;
}

.step-panel a {
  color: var(--ekai-teal);
  font-weight: 500;
  text-decoration: none;
}

.step-panel a:hover {
  text-decoration: underline;
}

#step-5 {
  max-height: 520px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#step-5::-webkit-scrollbar {
  width: 8px;
}

#step-5::-webkit-scrollbar-thumb {
  background: var(--ekai-border);
  border-radius: 4px;
}

#step-5::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Success step ── */

.step-panel .success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--ekai-teal-light);
  border-radius: 50%;
  margin-bottom: 1rem;
}

.step-panel .success-icon svg {
  width: 28px;
  height: 28px;
  color: var(--ekai-teal);
}

/* ── Form ── */

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ekai-dark);
}

input, select {
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  border: 1px solid var(--ekai-border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--ekai-white);
  color: var(--ekai-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  border-color: var(--ekai-teal);
  box-shadow: 0 0 0 3px rgba(84, 164, 160, 0.15);
}

.field-warning {
  font-size: 0.8rem;
  color: #d32f2f;
  margin-top: 0.3rem;
}


input::placeholder {
  color: #bbb;
}

/* ── Summary ── */

.summary {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}

.summary dt {
  font-weight: 600;
  color: var(--ekai-text-muted);
}

.summary dd {
  margin: 0;
  color: var(--ekai-dark);
}

.hint {
  font-size: 0.85rem;
  color: #999;
}

/* ── Actions ── */

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ekai-border);
}

button {
  padding: 0.625rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:active {
  transform: scale(0.98);
}

button:not(.btn-secondary) {
  background: var(--ekai-orange);
  color: #fff;
}

button:not(.btn-secondary):hover {
  background: var(--ekai-orange-hover);
}

.btn-secondary {
  background: var(--ekai-teal-light);
  color: var(--ekai-teal);
}

.btn-secondary:hover {
  background: #d4e8e8;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Invite Form (index page) ── */

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

.invite-card .logo {
  margin-bottom: 2rem;
}

.invite-card .logo img {
  height: 40px;
  width: auto;
}

.invite-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ekai-dark);
  margin: 0 0 0.5rem;
}

.invite-card p {
  color: var(--ekai-text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.75rem;
  line-height: 1.5;
}

.invite-card .field {
  text-align: left;
}

.invite-card button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* ── Footer ── */

.footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #aaa;
}

.footer a {
  color: var(--ekai-teal);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ── Troubleshooting Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--ekai-white);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ekai-border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

button.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ekai-text-muted);
  padding: 0;
  width: 2rem;
  height: 2rem;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

button.modal-close:hover {
  color: var(--ekai-dark);
  background: var(--ekai-teal-light);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--ekai-dark);
}

.modal-body p,
.modal-body ol {
  font-size: 0.9rem;
  color: var(--ekai-text-muted);
  line-height: 1.6;
}

.modal-body hr {
  border: none;
  border-top: 1px solid var(--ekai-border);
  margin: 1.25rem 0;
}

.troubleshoot-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.troubleshoot-table td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--ekai-border);
  vertical-align: middle;
}

.troubleshoot-table td:last-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.troubleshoot-table td:last-child code {
  flex: 1;
}

.troubleshoot-table td:first-child {
  width: 40%;
  font-size: 0.8rem;
  color: var(--ekai-text-muted);
}

.troubleshoot-table code {
  background: #f5f5f5;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
  word-break: break-all;
}

button.copy-btn {
  background: none;
  border: 1px solid var(--ekai-border);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 5px;
  font-size: 0.85rem;
  vertical-align: middle;
  opacity: 0.6;
  transition: opacity 0.2s;
}

button.copy-btn:hover {
  opacity: 1;
  background: var(--ekai-teal-light);
}

#troubleshoot-link {
  color: var(--ekai-teal);
  text-decoration: none;
  font-weight: 600;
}

#troubleshoot-link:hover {
  text-decoration: underline;
}

/* ── Responsive ── */

@media (max-width: 560px) {
  .container {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
  }

  .header {
    padding: 1rem 1.25rem;
  }

  .progress-label {
    font-size: 0.62rem;
  }
}
