/* =====================================================
   EVALORA STUDENT VERIFICATION PWA
   Stylesheet v2.0
   ===================================================== */

/* ===== CSS VARIABLES ===== */
:root {
  --color-primary: #000;
  --color-success: #22c55e;
  --color-error: #dc2626;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;
  
  --color-bg: #f8f4f1;
  --color-surface: #ffffff;
  --color-text: #1d1d1f;
  --color-text-secondary: #666;
  --color-text-tertiary: #999;
  --color-border: rgba(0, 0, 0, 0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  
  --transition: 0.2s ease;
  
  /* Safe areas for notched devices */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

/* ===== APP CONTAINER ===== */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  background: var(--color-bg);
}

.loading-content {
  text-align: center;
}

.loading-content .logo {
  height: 48px;
  margin-bottom: 24px;
}

.loading-content p {
  margin-top: 16px;
  color: var(--color-text-secondary);
}

/* ===== CARD ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 640px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.5s ease;
}

.card-narrow {
  max-width: 480px;
}

/* ===== LOGO ===== */
.logo-container {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  height: 44px;
  width: auto;
}

/* ===== TYPOGRAPHY ===== */
.title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.section-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}

/* ===== INSTALL SCREEN ===== */
.install-icon,
.extension-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-icon svg,
.extension-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--color-primary);
}

.install-instructions {
  margin: 28px 0;
}

.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.instruction-step:last-child {
  border-bottom: none;
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content p {
  font-size: 15px;
  margin-bottom: 4px;
}

.step-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.icon-inline {
  display: inline-block;
  font-size: 18px;
  vertical-align: middle;
}

.install-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius);
  font-size: 13px;
  color: #1e40af;
  margin-top: 24px;
}

.install-note svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-info);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== EXTENSION SCREEN ===== */
.browser-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.browser-btn {
  text-decoration: none;
}

.browser-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.extension-instructions {
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.extension-instructions h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.extension-instructions ol {
  margin-left: 20px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.extension-instructions li {
  margin-bottom: 8px;
}

.error-text {
  color: var(--color-error);
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
  padding: 12px;
  background: rgba(220, 38, 38, 0.1);
  border-radius: var(--radius-sm);
}

/* ===== USER INFO BANNER ===== */
.user-info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.user-info-banner svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-success);
  flex-shrink: 0;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-info-text strong {
  font-size: 15px;
  font-weight: 600;
}

.user-info-text span {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ===== INFO SECTIONS ===== */
.info-sections {
  margin-bottom: 24px;
}

.info-section {
  padding: 20px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.info-section:last-child {
  margin-bottom: 0;
}

.info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.info-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.info-header .icon {
  width: 20px;
  height: 20px;
  stroke: var(--color-primary);
}

.info-section p {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.info-section ul,
.info-section ol {
  margin-left: 20px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.info-section li {
  margin-bottom: 6px;
}

.info-section strong {
  color: var(--color-text);
}

/* ===== INFO TIP ===== */
.info-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 13px;
  color: #1e40af;
}

.info-tip svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-info);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== CONSENT BOX ===== */
.consent-box {
  padding: 20px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkbox-label:hover .checkmark {
  border-color: rgba(0, 0, 0, 0.4);
}

.checkbox-label input:checked ~ .checkmark {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.checkbox-label input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== INPUTS ===== */
.code-input-wrapper {
  margin-bottom: 24px;
}

.code-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 20px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: var(--transition);
  -webkit-appearance: none;
}

.code-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.code-input.error {
  border-color: var(--color-error);
  animation: shake 0.4s ease;
}

.code-input.success {
  border-color: var(--color-success);
  background: rgba(34, 197, 94, 0.05);
}

.code-input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.text-input,
.search-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: var(--transition);
  -webkit-appearance: none;
}

.text-input:focus,
.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.input-hint {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
  text-align: center;
}

.status-text {
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
  min-height: 20px;
}

.status-text.validating { color: var(--color-info); }
.status-text.success { color: var(--color-success); }
.status-text.error { color: var(--color-error); }

/* ===== ERROR MESSAGE ===== */
.error-message {
  padding: 12px 16px;
  background: rgba(220, 38, 38, 0.1);
  border-radius: var(--radius-sm);
  color: var(--color-error);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
  text-align: center;
}

.error-message.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ===== USER PREVIEW ===== */
.user-preview {
  padding: 20px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: none;
}

.user-preview.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.user-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-success);
  font-weight: 600;
  margin-bottom: 12px;
}

.user-preview-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 14px;
}

.user-preview-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.user-preview-row .label {
  color: var(--color-text-secondary);
}

.user-preview-row .value {
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  width: 100%;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
}

.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #16a34a;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 14px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}

.link-btn:hover {
  color: var(--color-primary);
}

/* ===== SPINNER ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner.large {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.btn-secondary .spinner,
.loading-content .spinner {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--color-primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SEARCH SECTION ===== */
.search-section {
  margin-bottom: 24px;
}

.search-input-wrapper {
  position: relative;
}

.search-input {
  padding-right: 50px;
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  -webkit-appearance: none;
}

.search-btn:hover {
  background: #333;
}

.search-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== PORTAL RESULTS ===== */
.known-portals-section {
  margin-bottom: 24px;
}

.known-portals-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.results-section {
  margin-bottom: 24px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  color: var(--color-text-secondary);
}

.loading-state .spinner {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--color-primary);
}

.portal-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.portal-item:hover {
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.portal-item:active {
  transform: translateY(0);
}

.portal-icon {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-text-secondary);
}

.portal-content {
  flex: 1;
  min-width: 0;
}

.portal-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-url {
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-family: 'SF Mono', 'Menlo', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-arrow {
  width: 20px;
  height: 20px;
  stroke: var(--color-text-tertiary);
  flex-shrink: 0;
}

.no-results {
  text-align: center;
  padding: 24px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* ===== BADGE ===== */
.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-green {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

/* ===== MANUAL ENTRY ===== */
.manual-entry {
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.manual-entry .text-input {
  margin-bottom: 12px;
}

/* ===== VERIFICATION SCREEN ===== */
#verification-screen.active {
  padding: 0;
  align-items: stretch;
}

.verification-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
}

.verification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: calc(12px + var(--safe-top));
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-logo {
  height: 28px;
  width: auto;
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-success);
}

.domain-badge .icon-lock {
  width: 14px;
  height: 14px;
}

.verification-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.verification-status {
  margin-bottom: 40px;
}

.status-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--color-info);
}

.status-icon .spinning {
  animation: spin 2s linear infinite;
}

#verification-status-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

#verification-status-text {
  font-size: 15px;
  color: var(--color-text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* ===== VERIFICATION PROGRESS ===== */
.verification-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.progress-step .step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-step .step-icon svg {
  width: 20px;
  height: 20px;
  stroke: #ccc;
}

.progress-step .step-icon.active {
  background: rgba(59, 130, 246, 0.1);
}

.progress-step .step-icon.active svg {
  stroke: var(--color-info);
}

.progress-step .step-icon.done {
  background: rgba(34, 197, 94, 0.1);
}

.progress-step .step-icon.done svg {
  stroke: var(--color-success);
}

.progress-step .step-icon.error {
  background: rgba(220, 38, 38, 0.1);
}

.progress-step .step-icon.error svg {
  stroke: var(--color-error);
}

.progress-step span {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.progress-connector {
  width: 40px;
  height: 2px;
  background: #e5e5e5;
  margin-bottom: 20px;
}

/* ===== ATTEMPTS COUNTER ===== */
.attempts-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  font-size: 14px;
}

.attempts-label {
  color: var(--color-text-secondary);
}

.attempts-value {
  font-weight: 600;
  color: var(--color-text);
}

/* ===== CONFIRM SCREEN ===== */
.name-display {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  padding: 24px;
  background: #f8f8f8;
  border-radius: var(--radius);
  text-align: center;
  margin: 24px 0;
}

.name-question {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  font-size: 15px;
}

.name-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.name-buttons .btn {
  flex: 1;
}

.evidence-summary {
  background: #f8f8f8;
  border-radius: var(--radius);
  padding: 20px;
}

.evidence-summary h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text-secondary);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--color-text-secondary);
}

.summary-value {
  font-weight: 600;
  color: var(--color-success);
}

/* ===== SUCCESS SCREEN ===== */
#success-screen.active {
  background: var(--color-bg);
}

.success-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--color-success);
}

.success-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

.success-content > p {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.success-details {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
}

.success-note {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-bottom: 20px;
}

.success-content .btn {
  width: auto;
  padding: 12px 48px;
}

/* ===== ERROR SCREEN ===== */
#error-screen .error-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#error-screen .error-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--color-error);
}

#error-screen .title {
  color: var(--color-error);
}

#error-screen .error-message {
  display: block;
  margin-bottom: 24px;
}

.error-actions {
  display: flex;
  gap: 12px;
}

.error-actions .btn {
  flex: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .screen.active {
    padding: 16px;
  }
  
  .card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }
  
  .title {
    font-size: 22px;
  }
  
  .subtitle {
    font-size: 14px;
  }
  
  .code-input {
    font-size: 18px;
    padding: 16px;
    letter-spacing: 1px;
  }
  
  .name-display {
    font-size: 22px;
    padding: 20px;
  }
  
  .name-buttons {
    flex-direction: column;
  }
  
  .error-actions {
    flex-direction: column;
  }
  
  .verification-progress {
    transform: scale(0.9);
  }
  
  .progress-connector {
    width: 24px;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 24px 16px;
  }
  
  .title {
    font-size: 20px;
  }
  
  .code-input {
    font-size: 16px;
    letter-spacing: 0.5px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .info-section {
    padding: 16px;
  }
  
  .portal-item {
    padding: 12px;
  }
  
  .portal-icon {
    width: 36px;
    height: 36px;
  }
}

/* ===== DARK MODE (optional, respects system preference) ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-surface: #2d2d2d;
    --color-text: #f5f5f5;
    --color-text-secondary: #a0a0a0;
    --color-text-tertiary: #707070;
    --color-border: rgba(255, 255, 255, 0.1);
  }
  
  .btn-primary {
    background: #fff;
    color: #000;
  }
  
  .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
  }
  
  .code-input,
  .text-input,
  .search-input {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
  }
  
  .code-input.success {
    background: rgba(34, 197, 94, 0.15);
  }
  
  .portal-item {
    background: var(--color-surface);
    border-color: var(--color-border);
  }
  
  .info-section,
  .consent-box,
  .name-display,
  .evidence-summary {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .checkmark {
    border-color: rgba(255, 255, 255, 0.3);
  }
  
  .install-icon,
  .extension-icon,
  .status-icon {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .install-icon svg,
  .extension-icon svg {
    stroke: var(--color-text);
  }
  
  .search-btn {
    background: #fff;
  }
  
  .search-btn svg {
    stroke: #000;
  }
  
  .spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
  }
  
  .step-number {
    background: #fff;
    color: #000;
  }
}

/* ===== PRINT ===== */
@media print {
  .screen {
    display: none !important;
  }
  
  #success-screen {
    display: block !important;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FOCUS STATES ===== */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline-offset: 4px;
}

/* ===== SCROLLBAR (Webkit) ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}