@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&family=Outfit:wght@100..900&display=swap');

:root {
  --primary-color: #3399FF;
  --background-color: #111;
  --text-color: #fff;
  --text-muted: #999;
  --card-bg: #1a1a1a;
  --card-border: #333;
  --success-color: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --error-color: #ef4444;
  --word-bg: #222;
  --word-border: #444;
  --word-selected-bg: rgba(51, 153, 255, 0.15);
  --word-selected-border: var(--primary-color);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Outfit', 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app {
  width: 100%;
  max-width: 480px;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sticky header */
.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 12px 24px;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s ease;
  pointer-events: none;
}

.sticky-header.visible {
  opacity: 1;
  transform: translateY(0);
  border-bottom-color: var(--card-border);
  pointer-events: auto;
}

.sticky-logo {
  width: 100px;
  height: auto;
  display: block;
}

/* Header */
.header {
  text-align: center;
  padding: 30px 0 20px;
}

.header img {
  width: 160px;
  height: auto;
  margin-bottom: 8px;
  transition: opacity 0.4s ease;
}

.header img.faded {
  opacity: 0;
}

.header .subtitle {
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-color);
}

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

.btn-primary:hover {
  background: #2a7acc;
}

.btn-primary:disabled {
  background: #555;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.btn-google:hover {
  background: #f5f5f5;
}

.btn-linkedin {
  background: #0077B5;
}

.btn-linkedin:hover {
  background: #006097;
}

.btn-github {
  background: #24292e;
}

.btn-github:hover {
  background: #1b1f23;
}

.btn-microsoft {
  background: #2f2f2f;
  border: 1px solid #555;
}

.btn-microsoft:hover {
  background: #404040;
}

.btn-facebook {
  background: #1877F2;
}

.btn-facebook:hover {
  background: #1466d2;
}

.btn-apple {
  background: #000;
  border: 1px solid #555;
}

.btn-apple:hover {
  background: #1a1a1a;
}

.btn-discord {
  background: #5865F2;
}

.btn-discord:hover {
  background: #4752c4;
}

.btn-tiktok {
  background: #010101;
  border: 1px solid #555;
}

.btn-tiktok:hover {
  background: #1a1a1a;
}

.btn-instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.btn-instagram:hover {
  opacity: 0.9;
}

.btn-youtube {
  background: #FF0000;
}

.btn-youtube:hover {
  background: #cc0000;
}

.btn-sms {
  background: #1a7a3a;
}

.btn-sms:hover {
  background: #156830;
}

.btn-email {
  background: #2a6fb5;
}

.btn-email:hover {
  background: #225d99;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--text-color);
  color: var(--text-color);
}

.btn-success {
  background: var(--success-color);
}

.btn-success:hover {
  background: #16a34a;
}

.btn + .btn {
  margin-top: 12px;
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* Role selection */
.role-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--text-color);
  font-family: inherit;
  width: 100%;
  box-shadow: 0 0 12px rgba(51, 153, 255, 0.08);
}

.role-btn:hover {
  background: rgba(51, 153, 255, 0.1);
  box-shadow: 0 0 20px rgba(51, 153, 255, 0.2);
  transform: translateY(-1px);
}

.role-btn:active {
  transform: translateY(0);
}

.role-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.role-text h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.role-text p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.role-chevron {
  margin-left: auto;
  font-size: 24px;
  color: var(--primary-color);
  flex-shrink: 0;
  line-height: 1;
}

/* Form inputs */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: #222;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-color);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary-color);
}

.form-input::placeholder {
  color: #555;
}

.handle-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.handle-input-row .form-input {
  flex: 1;
  min-width: 0;
}

.country-code-select {
  flex: 0 0 auto;
  max-width: 44%;
  padding: 12px 10px;
  font-size: 15px;
  font-family: inherit;
  background: #222;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-color);
  outline: none;
  transition: border-color 0.2s;
}

.country-code-select:focus {
  border-color: var(--primary-color);
}

/* Provider grid (12 providers in a 3-column grid) */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.provider-grid-messaging {
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--card-border);
  padding-top: 8px;
  margin-bottom: 16px;
}

.provider-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  background: #222;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.provider-tab:hover {
  border-color: #555;
  color: var(--text-color);
}

.provider-tab.active {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(51, 153, 255, 0.08);
}

.provider-tab-icon {
  width: 20px;
  height: 20px;
}

/* Provider logo list (landing page) */
.provider-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.provider-logo-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  background: #222;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-muted);
}

/* Word grid */
.word-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.word-chip {
  padding: 12px 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--word-bg);
  border: 2px solid var(--word-border);
  border-radius: 8px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  user-select: none;
}

.word-chip:hover {
  border-color: var(--primary-color);
}

.word-chip.selected {
  background: var(--word-selected-bg);
  border-color: var(--word-selected-border);
  font-weight: 600;
}

.word-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.word-count {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Display words (after match) */
.words-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.word-badge {
  background: var(--word-selected-bg);
  border: 1px solid var(--word-selected-border);
  border-radius: 8px;
  padding: 14px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
}

/* Waiting / loading states */
.waiting {
  text-align: center;
  padding: 24px 0 12px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--card-border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.waiting h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.waiting p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Success state */
.success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.success-card {
  text-align: center;
  border-color: var(--success-color);
}

.success-card h2 {
  color: var(--success-color);
}

/* Profile display */
.profile, .profile-card {
  background: #222;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

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

.profile-card-identity {
  flex: 1;
  min-width: 0;
}

.profile-pic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-weight: 600;
  font-size: 15px;
}

.profile-provider {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-card-details {
  border-top: 1px solid var(--card-border);
  padding: 4px 12px 8px;
}

.profile-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
  font-size: 13px;
  gap: 12px;
}

.profile-detail-row.wrap .profile-detail-value {
  white-space: normal;
  text-align: right;
}

.profile-detail-label {
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.profile-detail-value {
  color: var(--text-color);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.profile-detail-link {
  color: var(--primary-color);
  text-decoration: none;
}

.profile-detail-link:hover {
  text-decoration: underline;
}

/* Upsell */
.upsell {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid var(--card-border);
  margin-top: 20px;
}

.upsell p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Instructions callout */
/* Share options on waiting screen */
.share-options {
  background: rgba(51, 153, 255, 0.08);
  border: 1px solid rgba(51, 153, 255, 0.2);
  border-radius: 8px;
  padding: 14px;
  margin: 8px 0 16px;
  font-size: 14px;
}

.share-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--primary-color);
  font-weight: 500;
}

.btn-copy-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.btn-copy-link:hover {
  opacity: 0.7;
}

.share-or {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.callout {
  background: rgba(51, 153, 255, 0.08);
  border: 1px solid rgba(51, 153, 255, 0.2);
  border-radius: 8px;
  padding: 14px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #ccc;
}

.callout strong {
  color: var(--primary-color);
}

/* Privacy toast — shown when presenter is asked to sign in */
.privacy-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
}

.privacy-toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #22c55e;
  margin-top: 1px;
}

.privacy-toast-text {
  flex: 1;
}

.privacy-toast-text strong {
  color: #22c55e;
}

#revocation-status .privacy-toast {
  margin: 0 0 8px;
  padding: 10px 12px;
  font-size: 12.5px;
}

#revocation-status .privacy-toast + .privacy-toast {
  margin-top: 0;
}

.leave-no-trace {
  text-align: center;
  color: #fff;
  font-size: 13px;
  margin: 24px 0 8px;
}

/* Error */
.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 14px;
  color: var(--error-color);
  font-size: 14px;
  margin: 16px 0;
  text-align: center;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}

.footer a {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-color);
}

.footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--border-color);
}

.modal-icon {
  margin-bottom: 16px;
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-color);
}

.modal p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Screen visibility */
.screen { display: none; }
.screen.active { display: block; }

/* Anchor list (verifier setup) */
.anchor-list {
  margin-top: 16px;
}

.anchor-list-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.anchor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(51, 153, 255, 0.08);
  border: 1px solid rgba(51, 153, 255, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14px;
}

.anchor-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.anchor-item-provider {
  font-weight: 600;
  color: var(--primary-color);
  flex-shrink: 0;
}

.anchor-item-handle {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anchor-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  font-family: inherit;
}

.anchor-item-remove:hover {
  color: var(--error-color);
  background: rgba(239, 68, 68, 0.1);
}

/* Provider tab disabled state */
.provider-tab.used {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Provider coming soon state */
.provider-tab.provider-coming-soon {
  opacity: 0.4;
}
.provider-tab.provider-coming-soon:hover {
  opacity: 0.55;
  border-color: var(--border-color);
  background: var(--card-bg);
}

/* Contact line below provider grid */
.provider-contact {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 0;
}
.provider-contact a {
  color: var(--primary-color);
  text-decoration: none;
}
.provider-contact a:hover {
  text-decoration: underline;
}

/* Auth progress (verifier waiting screen) */
.auth-progress {
  margin: 16px 0;
}

.auth-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--card-border);
}

.auth-progress-item:last-child {
  border-bottom: none;
}

.auth-progress-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.auth-progress-item.completed .auth-progress-icon {
  color: var(--success-color);
}

.auth-progress-item.pending .auth-progress-icon {
  color: var(--text-muted);
}

.auth-progress-status {
  margin-left: auto;
  font-size: 12px;
}

/* Auth checklist (presenter multi-auth) */
.auth-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #222;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.auth-checklist-item.completed {
  border-color: var(--success-color);
  background: var(--success-bg);
}

.auth-checklist-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.auth-checklist-item.completed .auth-checklist-icon {
  color: var(--success-color);
}

/* Multiple profile cards spacing */
.profile-card + .profile-card {
  margin-top: 12px;
}

/* Security warning (for SMS/email providers) */
.security-warning {
  display: flex;
  gap: 10px;
  background: rgba(240, 173, 78, 0.1);
  border: 1px solid rgba(240, 173, 78, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.security-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  color: #f0ad4e;
}

.security-warning-text strong {
  display: block;
  font-size: 13px;
  color: #f0ad4e;
  margin-bottom: 4px;
}

.security-warning-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* PIN entry (presenter SMS/email verification) */
.pin-entry-group {
  background: #222;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 8px;
}

.pin-entry-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-color);
}

.pin-entry-label .btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pin-entry-row {
  display: flex;
  gap: 8px;
}

.pin-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 20px;
  font-family: 'Courier New', monospace;
  letter-spacing: 6px;
  text-align: center;
  background: var(--background-color);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-color);
  outline: none;
  transition: border-color 0.2s;
}

.pin-input:focus {
  border-color: var(--primary-color);
}

.pin-input::placeholder {
  color: #444;
  letter-spacing: 6px;
}

.pin-submit {
  width: auto;
  padding: 12px 20px;
  font-size: 14px;
  flex-shrink: 0;
}

.pin-entry-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  min-height: 20px;
}

.pin-error {
  font-size: 12px;
  color: var(--error-color);
}

.pin-resend {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.pin-resend:hover {
  text-decoration: underline;
}

.pin-resend:disabled {
  color: var(--text-muted);
  cursor: default;
  text-decoration: none;
}

/* Responsive */
@media (max-width: 380px) {
  .word-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .word-chip {
    padding: 10px 6px;
    font-size: 14px;
  }
}
