:root {
  color-scheme: light;
  --bg-page: #e9ecef;
  --card-bg: #ffffff;
  --ink: #1c252a;
  --ink-secondary: #495057;
  --muted: #6c757d;
  --border: #e2e8f0;
  --primary: #1c252a;
  --primary-hover: #0f1518;
  --accent-red: #a04e3d;
  --accent-blue: #3b5998;
  --radius-card: 20px;
  --radius-btn: 12px;
  --radius-item: 14px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 1rem 3rem;
  -webkit-font-smoothing: antialiased;
}

.card-wrapper {
  width: 100%;
  max-width: 440px;
}

/* Card Container */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px rgba(28, 37, 42, 0.08), 0 2px 6px rgba(28, 37, 42, 0.04);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(28, 37, 42, 0.06);
}

/* Cover Banner */
.card-cover {
  height: 95px;
  background: linear-gradient(135deg, #2b3940 0%, #1c252a 50%, #3d4f58 100%);
  position: relative;
}

.btn-qr-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-qr-badge:hover {
  background: #ffffff;
  transform: scale(1.08);
}

/* Profile Header */
.profile-header {
  padding: 0 1.5rem 0.5rem;
  text-align: center;
  position: relative;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: -55px;
  margin-bottom: 0.75rem;
}

.avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 65% 35%, #ecd9c7 0%, #caa98c 50%, #9e7f62 100%);
  border: 4px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: grid;
  place-items: center;
}

.avatar span {
  font: 700 2.1rem var(--font-display);
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 6px rgba(28, 37, 42, 0.35);
}

.verified-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-red);
  color: #ffffff;
  border: 2px solid #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.agent-name {
  font: 400 1.85rem/1.2 var(--font-display);
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.agent-title {
  font: 600 0.72rem var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 0.65rem;
}

.agent-tagline {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 22rem;
  margin: 0 auto;
}

/* Primary CTA Row: Save Contact + Exchange */
.cta-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem 0.5rem;
}

.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-btn);
  font: 600 0.88rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(28, 37, 42, 0.2);
  border: none;
}

.btn-primary:hover {
  background: var(--accent-red);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(160, 78, 61, 0.25);
}

.btn-secondary {
  background: #f1f4f6;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* Card Sections */
.card-section {
  padding: 1rem 1.5rem;
}

.section-heading {
  font: 600 0.68rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Contact Details Action Items List */
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-item);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.action-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateX(2px);
}

.action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-call { background: #e8f5e9; color: #2e7d32; }
.icon-sms { background: #e3f2fd; color: #1565c0; }
.icon-email { background: #fff3e0; color: #e65100; }
.icon-office { background: #ede7f6; color: #512da8; }
.icon-location { background: #fce4ec; color: #c2185b; }
.icon-web { background: #e0f2f1; color: #00796b; }

.action-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.action-label {
  font: 600 0.65rem var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.action-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-arrow {
  color: #94a3b8;
  font-size: 0.9rem;
  transition: transform 0.15s, color 0.15s;
}

.action-item:hover .action-arrow {
  color: var(--accent-red);
  transform: translateX(2px);
}

/* Connect Online Social Grid */
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-item);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.social-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-2px);
}

.social-btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.social-btn-inner span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

/* Footer */
.card-footer {
  padding: 0.85rem 1.25rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: #fbfbfb;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.footer-logo {
  height: 26px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  display: block;
  opacity: 0.9;
}

.compliance-mark {
  font: 500 0.62rem var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

/* Modal Dialogs */
.modal-dialog {
  border: none;
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  max-width: 380px;
  width: 90%;
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.modal-content {
  padding: 1.25rem 1.5rem 1.5rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font: 600 1.05rem var(--font-body);
  color: var(--ink);
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
}

.modal-intro {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.45;
}

.modal-body.text-center {
  text-align: center;
}

.qr-box {
  display: inline-block;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  margin-bottom: 0.75rem;
}

.qr-sub {
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 14rem;
  margin: 0 auto;
}

/* Modal Form */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font: 600 0.65rem var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 0.85rem var(--font-body);
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.12);
}

.btn-submit-exchange {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  margin-top: 0.35rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  font: 600 0.88rem var(--font-body);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-submit-exchange:hover {
  background: var(--accent-red);
  transform: translateY(-1px);
}

@media (max-width: 440px) {
  body {
    padding: 0;
    background-color: #ffffff;
  }
  .card-wrapper {
    max-width: 100%;
  }
  .card {
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
  .social-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.avatar-img {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: block;
}


.brokerage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brokerage-badge .era-icon {
  color: var(--accent-red);
}

.brokerage-badge .brokerage-sep {
  color: #94a3b8;
  font-size: 0.65rem;
}

.brokerage-badge .brokerage-lic {
  color: var(--ink-secondary);
  font-weight: 500;
}

/* Exchange Sent / Options Screen */
.exchange-sent-box {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.sent-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.sent-title {
  font: 600 1.1rem var(--font-body);
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.sent-desc {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.sent-action-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.sent-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.sent-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-gmail {
  background: #ea4335;
  color: #ffffff;
}

.btn-default-mail {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-sent-back {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem;
}

.btn-sent-back:hover {
  color: var(--ink);
  text-decoration: underline;
}