/* Custom CSS for Passkey Usability Lab */

:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', Courier, monospace;

  /* Color Palette */
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 22, 35, 0.65);
  --bg-card-hover: rgba(22, 28, 45, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.5);
  
  --color-primary: #38bdf8; /* Electric Blue */
  --color-primary-hover: #0ea5e9;
  --color-success: #10b981; /* Emerald Green */
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-warning: #f59e0b; /* Amber */
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #111827;

  --glow-blue: rgba(56, 189, 248, 0.15);
  --glow-purple: rgba(168, 85, 247, 0.15);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 60px;
}

/* Background Decorative Elements */
.glow-bg {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
}

.glow-blue {
  top: -100px;
  right: -50px;
  background: var(--glow-blue);
}

.glow-purple {
  bottom: 10%;
  left: -100px;
  background: var(--glow-purple);
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.4));
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header .subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  font-size: 0.825rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

/* Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  margin-top: 36px;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphic Panel/Card styles */
.panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.card-hero {
  background: linear-gradient(135deg, rgba(22, 28, 45, 0.8) 0%, rgba(10, 13, 20, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.card-hero h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--color-primary);
}

.card-hero p {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 14px;
}

.card-hero p:last-child {
  margin-bottom: 0;
}

.study-note {
  border-left: 3px solid var(--color-primary);
  padding-left: 12px;
  font-style: italic;
  color: var(--text-muted) !important;
}

.card h2, .card h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card h2 {
  font-size: 1.25rem;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.step-badge {
  background: var(--color-primary);
  color: var(--text-dark);
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.text-muted {
  color: var(--text-muted);
}

/* Forms & Controls */
.auth-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.input-group input[type="text"],
.input-group textarea {
  background: rgba(10, 13, 20, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus {
  border-color: var(--color-primary);
  background: rgba(10, 13, 20, 0.9);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--text-dark);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-main);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.875rem;
}

/* Dashboard States */
.card-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(10, 13, 20, 0.9) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.success-badge {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 8px;
}

.user-details {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.user-details code {
  color: var(--color-primary);
  font-family: var(--font-mono);
}

/* Table */
.table-container {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.credentials-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.credentials-table th, .credentials-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.credentials-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 500;
  color: var(--text-muted);
}

.credentials-table td {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.credentials-table tr:last-child td {
  border-bottom: none;
}

.dashboard-actions {
  margin-top: 16px;
}

/* Survey Form */
.survey-card {
  border-color: rgba(245, 158, 11, 0.2);
}

.survey-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.survey-question {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.survey-question label {
  font-weight: 500;
  font-size: 0.925rem;
}

.rating-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.rating-label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.rating-label:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rating-label input[type="radio"] {
  accent-color: var(--color-primary);
}

.success-alert {
  background-color: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
  color: var(--color-success);
  font-size: 0.9rem;
}

/* Hidden Utility */
.hidden {
  display: none !important;
}

/* ==================================================== */
/* Right Column: Educational Visuals                    */
/* ==================================================== */

/* Flow Diagram */
.visualizer-card {
  position: relative;
}

.flow-diagram {
  margin-top: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border-color);
}

.nodes-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  z-index: 10;
  opacity: 0.4;
  transition: all 0.4s ease;
}

.node.active {
  opacity: 1;
}

.node-icon {
  font-size: 2.2rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: all 0.4s ease;
}

.node.active .node-icon {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  animation: pulse-node 2.5s infinite;
}

.node-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.4s ease;
}

.node.active .node-label {
  color: var(--text-main);
}

/* Lines and Signals */
.flow-line-connector {
  flex-grow: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  margin: 0 -10px;
  margin-top: -24px;
}

.flow-signal {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
  top: -3px;
  left: 0;
  opacity: 0;
}

/* Signal Animations */
.signal-forward {
  animation: signal-go-forward 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  opacity: 1;
}

.signal-backward {
  animation: signal-go-backward 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  opacity: 1;
}

@keyframes signal-go-forward {
  0% { left: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes signal-go-backward {
  0% { left: 100%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 0%; opacity: 0; }
}

@keyframes pulse-node {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.flow-state-desc {
  font-size: 0.875rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--color-primary);
  line-height: 1.5;
}

.flow-state-desc strong {
  color: var(--color-primary);
}

/* Dev Payload Console */
.payload-card {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.payload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.console-indicator {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 700;
}

.console-indicator.active-log {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--color-primary);
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  font-family: var(--font-sans);
}

.btn-clear:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* Tabs */
.payload-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-top: 16px;
  padding-bottom: 1px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Tab contents */
.tab-contents {
  flex-grow: 1;
  margin-top: 14px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
}

.tab-pane.active {
  display: flex;
}

.pane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.http-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.http-badge.get {
  background: rgba(56, 189, 248, 0.1);
  color: var(--color-primary);
}

.http-badge.post {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.http-badge.verify {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.pane-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
}

pre {
  background: #06090f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  max-height: 380px;
  flex-grow: 1;
}

code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #f3f4f6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Syntax highlighters / formatting coloring */
.json-key { color: #f43f5e; }     /* Pink for keys */
.json-string { color: #34d399; }  /* Green for values */
.json-number { color: #fb923c; }  /* Orange for numbers */
.json-boolean { color: #a78bfa; } /* Purple for booleans */
.json-null { color: #9ca3af; }    /* Gray for null */

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  background-color: rgba(10, 13, 20, 0.8);
  padding: 20px 0;
  position: absolute;
  bottom: 0;
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Header Actions and Demo Toggle Switch */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.demo-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--color-warning);
  transition: all 0.2s ease;
}

.demo-toggle:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
}

.demo-toggle input {
  display: none;
}

.demo-toggle .slider {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.demo-toggle .slider::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.demo-toggle input:checked + .slider {
  background-color: var(--color-warning);
}

.demo-toggle input:checked + .slider::before {
  transform: translateX(12px);
  background-color: var(--bg-main);
}

/* Participant Guide & Console Mode Layouts */
.payload-header-modes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-mode-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  color: var(--text-main);
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-primary);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.4);
}

.mode-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mode-content.hidden {
  display: none !important;
}

/* Guide Step Cards */
.guide-step-card {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.guide-step-card h4 {
  font-size: 1.1rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.guide-step-desc {
  font-size: 0.925rem;
  line-height: 1.55;
  color: var(--text-main);
  margin-bottom: 18px;
}

.guide-insights {
  background: rgba(56, 189, 248, 0.04);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 12px;
  padding: 16px;
}

.guide-insights h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.insights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insights-list li {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
  position: relative;
  padding-left: 20px;
}

.insights-list li::before {
  content: "✨";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85rem;
}

/* Mobile Responsiveness Overrides */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .main-layout {
    margin-top: 20px;
    gap: 20px;
  }
}

@media (max-width: 540px) {
  .container {
    padding: 0 16px;
  }
  
  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .app-header h1 {
    font-size: 1.25rem;
  }

  /* Shrink nodes in live authentication flow so they don't break/overflow screen */
  .node {
    width: 70px;
  }

  .node-icon {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    margin-bottom: 4px;
  }

  .node-label {
    font-size: 0.725rem;
  }

  .flow-line-connector {
    margin-top: -16px;
  }

  /* Make tab header wrap if buttons are too wide */
  .payload-header-modes {
    flex-direction: column;
    align-items: flex-start;
  }

  .payload-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .panel-mode-selector {
    width: 100%;
  }

  .mode-btn {
    flex-grow: 1;
    justify-content: center;
  }
}



