/* demo-modal.css — Try Copat in-browser call demo */

/* ── Trigger button ─────────────────────────────────────────────────────────── */

#try-copat-btn {
  background: transparent;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-full);
  color: var(--color-accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 600;
  padding: 12px 24px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

#try-copat-btn:hover:not(:disabled) {
  background: var(--color-accent);
  color: #fff;
}

#try-copat-btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

#try-copat-btn.demo-btn-unavailable,
#try-copat-btn:disabled {
  border-color: var(--color-border-strong);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.demo-unavailable-msg {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  margin-top: var(--space-2);
  text-align: center;
}

/* ── Modal overlay ──────────────────────────────────────────────────────────── */

.demo-modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.55);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: var(--space-4);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 200;
}

.demo-modal-backdrop[hidden] {
  display: none;
}

body.demo-modal-open {
  overflow: hidden;
}

/* ── Modal card ─────────────────────────────────────────────────────────────── */

.demo-modal {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-height: calc(100vh - var(--space-8));
  max-width: 480px;
  overflow-y: auto;
  padding: var(--space-8) var(--space-8) var(--space-6);
  position: relative;
  width: 100%;
}

@media (max-width: 540px) {
  .demo-modal {
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-5) var(--space-5);
  }
}

/* ── Close button ───────────────────────────────────────────────────────────── */

.demo-modal-close {
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  right: var(--space-4);
  top: var(--space-4);
}

.demo-modal-close:hover {
  color: var(--color-text-primary);
}

.demo-modal-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Headings ───────────────────────────────────────────────────────────────── */

.demo-modal-heading {
  color: var(--color-text-primary);
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.demo-modal-subhead {
  color: var(--color-text-secondary);
  font-size: var(--fs-small);
  margin-bottom: var(--space-4);
}

.demo-modal-subhead--optional {
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-2);
}

/* ── Step container ─────────────────────────────────────────────────────────── */

.demo-step[hidden] {
  display: none;
}

/* ── Language picker ────────────────────────────────────────────────────────── */

.demo-lang-search-wrap {
  margin-bottom: var(--space-3);
}

.demo-lang-search {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  padding: 10px var(--space-4);
  width: 100%;
}

.demo-lang-search:focus {
  border-color: var(--color-accent);
  outline: none;
}

.demo-lang-list-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-height: 260px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.demo-lang-group {
  padding: var(--space-2) 0;
}

.demo-lang-group:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.demo-lang-group[hidden] {
  display: none;
}

.demo-lang-group-label {
  color: var(--color-text-muted);
  font-size: var(--fs-tiny);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: var(--space-2) var(--space-4) var(--space-2);
  text-transform: uppercase;
}

.demo-lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.demo-lang-item {
  color: var(--color-text-primary);
  cursor: pointer;
  font-size: var(--fs-body);
  padding: 10px var(--space-4);
  transition: background 0.1s;
}

.demo-lang-item[hidden] {
  display: none;
}

.demo-lang-item:hover {
  background: var(--color-primary-soft);
}

.demo-lang-item:focus-visible {
  background: var(--color-primary-soft);
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.demo-lang-item--selected {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
}

.demo-lang-empty {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  padding: var(--space-4);
  text-align: center;
}

.demo-lang-request-row {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.demo-lang-request-link {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-lang-request-link:hover {
  color: var(--color-primary);
}

.demo-lang-request-link:disabled {
  color: var(--color-text-muted);
  cursor: default;
  text-decoration: none;
}

.demo-lang-request-thanks {
  color: var(--color-text-secondary);
  font-size: var(--fs-small);
}

/* ── Personalization form ───────────────────────────────────────────────────── */

.demo-label {
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  margin-bottom: var(--space-2);
  margin-top: var(--space-4);
}

.demo-input {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  padding: 10px var(--space-4);
  width: 100%;
}

.demo-input:focus {
  border-color: var(--color-accent);
  outline: none;
}

/* ── Button row ─────────────────────────────────────────────────────────────── */

.demo-btn-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.demo-btn-row--center {
  align-items: center;
}

@media (min-width: 420px) {
  .demo-btn-row:not(.demo-btn-row--center):not(.demo-btn-row--stack) {
    flex-direction: row;
  }
}

.demo-btn-row--stack .btn {
  width: 100%;
  justify-content: center;
  flex-direction: column;
  line-height: 1.3;
}

.demo-btn-sub {
  display: block;
  font-size: 0.78em;
  font-weight: 400;
  opacity: 0.72;
  margin-top: 2px;
}

/* ── Loading step ───────────────────────────────────────────────────────────── */

.demo-loading-icon {
  margin-bottom: var(--space-4);
  text-align: center;
}

.demo-spinner {
  animation: demo-spin 0.8s linear infinite;
  border: 3px solid var(--color-border);
  border-radius: 50%;
  border-top-color: var(--color-accent);
  display: inline-block;
  height: 36px;
  width: 36px;
}

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

/* ── Call step ──────────────────────────────────────────────────────────────── */

/* Brand header — mascot + wordmark */
.demo-call-header {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
}

.demo-call-avatar {
  border-radius: 50%;
  flex-shrink: 0;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.demo-call-header-text {
  text-align: left;
}

.demo-call-wordmark {
  color: var(--color-primary);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.demo-wordmark-dot {
  color: var(--color-accent);
}

.demo-call-tag {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Business identity chip */
.demo-biz-chip {
  align-items: center;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-5);
  padding: var(--space-2) var(--space-4);
}

.demo-biz-chip-label {
  color: var(--color-text-muted);
  flex-shrink: 0;
  font-size: var(--fs-small);
}

.demo-biz-chip-name {
  color: var(--color-text-primary);
  font-size: var(--fs-small);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* AI disclosure — subtle footer, replaces the blue banner */
.demo-ai-disclosure {
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 11px;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  text-align: center;
}

.demo-call-status-wrap {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-4);
}

.demo-call-dot {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
  background: var(--color-border-strong);
}

.demo-call-dot--connecting {
  animation: demo-pulse 1.2s ease-in-out infinite;
  background: #f59e0b;
}

.demo-call-dot--active {
  animation: demo-pulse 1.8s ease-in-out infinite;
  background: var(--color-accent);
}

@keyframes demo-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.demo-call-status {
  color: var(--color-text-secondary);
  font-size: var(--fs-body);
}

.demo-timer-wrap {
  margin-bottom: var(--space-3);
  text-align: center;
}

.demo-timer {
  color: var(--color-text-primary);
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.demo-timer--warning {
  color: #ef4444;
}

.demo-timer-warning {
  color: #ef4444;
  font-size: var(--fs-small);
  font-weight: 600;
  margin-bottom: var(--space-4);
  text-align: center;
}

/* End call button — red hangup */
.demo-end-call-btn {
  align-items: center;
  background: #dc2626;
  border: 2px solid #991b1b;
  border-radius: var(--radius-full);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 700;
  gap: 8px;
  padding: 13px 40px;
  transition: background 0.15s, border-color 0.15s;
}

.demo-end-call-btn:hover {
  background: #b91c1c;
  border-color: #7f1d1d;
}

.demo-end-call-btn:active {
  background: #991b1b;
}

.demo-end-call-btn:focus-visible {
  outline: 3px solid #dc2626;
  outline-offset: 3px;
}

.demo-end-call-icon {
  flex-shrink: 0;
  transform: rotate(135deg);
}

/* ── Post-call ──────────────────────────────────────────────────────────────── */

.demo-postcall-icon {
  background: #dcfce7;
  border-radius: 50%;
  color: #16a34a;
  font-size: 24px;
  height: 56px;
  line-height: 56px;
  margin: 0 auto var(--space-4);
  text-align: center;
  width: 56px;
}

.demo-crawl-fail-icon {
  background: #fef3c7;
  border-radius: 50%;
  color: #b45309;
  font-size: 26px;
  height: 56px;
  line-height: 56px;
  margin: 0 auto var(--space-4);
  text-align: center;
  width: 56px;
}

.demo-modal-subhead--crawl-fail {
  font-size: var(--fs-body);
  line-height: 1.55;
  margin-bottom: var(--space-5);
}

.demo-postcall-close-row {
  margin-top: var(--space-3);
  text-align: center;
}

.demo-text-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-text-btn:hover {
  color: var(--color-text-secondary);
}

/* ── Error messages ─────────────────────────────────────────────────────────── */

.demo-step-error {
  color: #dc2626;
  font-size: var(--fs-small);
  margin-top: var(--space-3);
  min-height: 20px;
}

/* ── SR-only ────────────────────────────────────────────────────────────────── */

.demo-sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ── Core / native language items — bold blue ───────────────────────────────── */

.demo-lang-item--core {
  color: var(--color-primary);
  font-weight: 700;
}

.demo-lang-item--core:hover {
  background: var(--color-primary-soft);
}

.demo-lang-item--core.demo-lang-item--selected {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* ── Fallback notice ────────────────────────────────────────────────────────── */

.demo-fallback-notice {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: var(--fs-small);
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-3);
  text-align: center;
}

/* ── Post-call CTA email row ────────────────────────────────────────────────── */

.demo-cta-input-row {
  align-items: stretch;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.demo-cta-input-row .demo-input {
  flex: 1;
  min-width: 0;
}

.demo-cta-success {
  color: #065f46;
  font-size: 15px;
  font-weight: 600;
  margin: 12px 0;
  text-align: center;
}
