:root {
  --base: #050d34;
  --royal: #234aa5;
  --glow: #4166e0;
  --gold: #f7b72f;
  --text: #f8f7f0;
  --muted: #aaa9b9;
  --card-width: 330px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--base);
  background-attachment: fixed;
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px 14px 30px;
}

.business-card {
  width: min(var(--card-width), 94vw);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9,20,67,.96), rgba(3,8,37,.98));
  box-shadow: 0 28px 90px rgba(0,0,0,.48), inset 0 0 35px rgba(80,110,255,.08);
  position: relative;
}

.hero {
  height: 338px;
  background:
    radial-gradient(circle at 50% 10%, rgba(86,119,255,.6), transparent 55%),
    linear-gradient(180deg, #244eb3, #081542);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: saturate(1.05) contrast(1.02);
}

.card-body {
  text-align: center;
  padding: 12px 16px 16px;
}

.initial-badge {
  width: 42px;
  height: 42px;
  margin: -1px auto 7px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(5,13,52,.92);
  border: 1px solid rgba(247,183,47,.28);
  font-family: Georgia, serif;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}

.location {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.05;
  font-weight: 700;
}

.role {
  color: #dddbe3;
  font-size: 9px;
  line-height: 1.4;
  margin: 8px 0 14px;
}

.primary-action,
.secondary-action {
  border: 1px solid rgba(247,183,47,.13);
  cursor: pointer;
  text-decoration: none;
  transition: .2s ease;
}

.primary-action {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffc447, #ee9e13);
  color: #16120a;
  font-weight: 700;
  font-size: 11px;
  box-shadow: 0 8px 24px rgba(240,165,31,.18);
}

.primary-action:hover, .gold-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.two-actions,
.three-actions {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.two-actions { grid-template-columns: 1fr 1fr; }
.three-actions { grid-template-columns: repeat(3, 1fr); }

.secondary-action {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  color: #eeeef4;
  background: rgba(8,16,55,.65);
  border-color: rgba(106,126,207,.18);
  font-size: 9px;
}

.secondary-action:hover,
.website-row:hover { border-color: rgba(247,183,47,.38); background: rgba(20,32,86,.85); }

.three-actions .secondary-action {
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}

.three-actions small {
  font-size: 8px;
}

.section-divider {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--gold);
  font-size: 7px;
  letter-spacing: 2.5px;
  font-weight: 800;
}

.section-divider::before,
.section-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(150,158,195,.13);
}

.website-row {
  min-height: 43px;
  border: 1px solid rgba(106,126,207,.18);
  border-radius: 9px;
  background: rgba(8,16,55,.55);
  display: grid;
  grid-template-columns: 26px 1fr 18px;
  align-items: center;
  text-align: left;
  padding: 7px 10px;
  color: #fff;
  text-decoration: none;
  transition: .2s ease;
}

.website-icon {
  width: 23px;
  height: 23px;
  border: 1px solid rgba(247,183,47,.3);
  color: var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.website-row strong { display: block; font-size: 8px; }
.website-row small { display: block; color: #c1c0cb; font-size: 7px; margin-top: 2px; }
.arrow { color: var(--gold); text-align: right; }

.footer-text {
  color: #858694;
  font-size: 7px;
  line-height: 1.4;
  margin: 14px 0 0;
}

.settings-fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1);
  color: #b6b8c5;
  background: rgba(3,8,32,.75);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,.3);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,5,25,.72);
  backdrop-filter: blur(9px);
}

.hidden { display: none !important; }

.modal {
  z-index: 1001;
  width: min(820px, 94vw);
  max-height: 94vh;
  overflow-y: auto;
  position: relative;
  border-radius: 22px;
  padding: 28px;
  color: #172246;
  background: #f7f5ef;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}

.pin-modal { width: min(760px, 92vw); }
.edit-modal { width: min(820px, 92vw); }

.modal h2 {
  margin: 0 0 18px;
  font-size: 32px;
  color: #18254e;
}

.modal p {
  color: #6e7487;
  line-height: 1.5;
  font-size: 16px;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  border: 0;
  background: transparent;
  color: #6f7483;
  font-size: 27px;
  cursor: pointer;
}

.modal label {
  display: block;
  margin: 0 0 16px;
  color: #69718a;
  font-size: 15px;
}

.modal input[type="text"],
.modal input[type="password"],
.modal input[type="email"],
.modal input[type="tel"],
.modal input[type="url"],
.modal input[type="file"],
.modal label > input:not([type="color"]) {
  width: 100%;
  margin-top: 7px;
  padding: 15px 17px;
  border-radius: 12px;
  border: 1px solid #d7d7d5;
  outline: none;
  background: #fff;
  color: #20283f;
}

.modal input:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(35,74,165,.1);
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.blue-btn,
.gold-btn,
.light-btn {
  min-height: 54px;
  border-radius: 12px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  border: 1px solid #d5d5d2;
}

.blue-btn {
  background: var(--royal);
  color: white;
  border-color: transparent;
}

.gold-btn {
  background: linear-gradient(180deg, #ffc04a, #eda119);
  color: #211707;
  border-color: transparent;
}

.light-btn {
  background: #f7f6f2;
  color: #262b39;
}

.full { width: 100%; margin-top: 10px; }

.error-message {
  min-height: 18px;
  margin: 7px 0 0 !important;
  color: #b32222 !important;
  font-size: 12px !important;
}

.password-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}

.password-section .light-btn { margin-top: 8px; }
#passwordMessage { min-height: 18px; margin: 8px 0 0; }

.password-input-wrap {
  position: relative;
  display: block;
  margin-top: 7px;
}

.password-input-wrap input {
  margin-top: 0 !important;
  padding-right: 48px !important;
}

.eye-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
}

.eye-btn:hover { background: rgba(35,74,165,.08); }

.settings-status {
  display: none;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.settings-status.show { display: block; }
.settings-status.success { background: #e9fff3; color: #08733f; border: 1px solid #39d98a; }
.settings-status.error { background: #fff0f2; color: #a82031; border: 1px solid #ff5b6e; }
.settings-status.info { background: #eef3ff; color: #234aa5; border: 1px solid #9db5ff; }

.theme-section {
  margin: 20px 0 6px;
}

.theme-title {
  color: #69718a;
  font-size: 15px;
  margin-bottom: 10px;
}

.color-pickers {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.color-pickers label {
  width: 62px;
  text-align: center;
  margin: 0;
}

.color-pickers input[type="color"] {
  width: 54px;
  height: 42px;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.color-pickers span {
  font-size: 10px;
  color: #70768a;
}

.qr-modal { width: min(380px, 92vw); text-align: center; }
#qrcode { display: flex; justify-content: center; margin: 20px auto; }
#qrUrlText { word-break: break-all; font-size: 11px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 100;
  transform: translate(-50%, 25px);
  opacity: 0;
  pointer-events: none;
  background: #111a43;
  color: white;
  border: 1px solid rgba(255,255,255,.13);
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 12px;
  transition: .25s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 520px) {
  .business-card { min-height: 0; }
  .hero { height: 300px; }
  .modal { padding: 23px 18px; }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .modal-actions { grid-template-columns: 1fr; }
}

@media (min-width: 800px) {
  .business-card { width: 350px; }
  .hero { height: 360px; }
}


@media (min-width: 900px) {
  .edit-modal {
    padding: 34px 38px;
  }

  .edit-modal h2 {
    font-size: 34px;
  }

  .edit-modal label {
    font-size: 15px;
  }

  .edit-modal input[type="text"],
  .edit-modal input[type="password"],
  .edit-modal input[type="email"],
  .edit-modal input[type="tel"],
  .edit-modal input[type="url"],
  .edit-modal input[type="file"],
  .edit-modal label > input:not([type="color"]) {
    font-size: 16px;
    min-height: 52px;
  }

  .edit-modal .blue-btn,
  .edit-modal .gold-btn,
  .edit-modal .light-btn {
    font-size: 15px;
  }

  .edit-modal .two-fields {
    gap: 18px;
  }
}


.extra-links {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.extra-link-row {
  margin: 0;
}

.links-editor {
  margin: 22px 0 10px;
  padding: 18px;
  border: 1px solid #dededb;
  border-radius: 14px;
  background: #efeee9;
}

.links-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.links-editor-head .theme-title {
  margin: 0 0 4px;
}

.links-editor-head small {
  color: #7a7f90;
  line-height: 1.45;
  font-size: 12px;
}

.add-link-btn {
  min-height: 42px;
  white-space: nowrap;
  margin: 0;
}

.link-editor-row {
  display: grid;
  grid-template-columns: 58px 1fr 1.5fr 44px;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
}

.link-editor-row input {
  margin-top: 0 !important;
  min-height: 44px;
}

.link-icon-input {
  text-align: center;
  font-size: 18px !important;
}

.remove-link-btn {
  width: 44px;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  color: #a82a2a;
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 650px) {
  .links-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .link-editor-row {
    grid-template-columns: 48px 1fr 44px;
  }

  .link-editor-row input:nth-child(3) {
    grid-column: 1 / -1;
  }

  .link-editor-row input:nth-child(2) {
    grid-column: 2;
  }

  .link-editor-row .remove-link-btn {
    grid-column: 3;
    grid-row: 1;
  }
}

.hidden-front-link {
  display: none !important;
}


.quick-link-buttons {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 10px 0 8px;
}
.quick-link {
  border:1px solid #d4d4d0;
  background:#fff;
  color:#27304a;
  border-radius:999px;
  padding:9px 13px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.quick-link:hover { border-color:var(--royal); }
.preview-modal { width:min(980px,96vw); }
.preview-card-wrap {
  min-height: 520px;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding:20px;
  border-radius:18px;
  background:linear-gradient(135deg,#e9edf7,#f8f6ef);
  overflow:auto;
}
.preview-card-wrap .business-card {
  width:350px;
  flex:0 0 350px;
}
.preview-actions { margin-top:14px; }
@media (max-width:650px) {
  .preview-card-wrap { padding:10px; }
  .preview-card-wrap .business-card { width:min(350px,90vw); flex-basis:min(350px,90vw); }
}

.field-help {
  margin: -4px 0 12px;
  color: #69728a;
  font-size: 12px;
  line-height: 1.5;
}

.quick-link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.quick-link {
  border: 1px solid #d8deea;
  background: #f7f9fc;
  color: #17234d;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
}

.quick-link:hover {
  border-color: var(--royal);
  transform: translateY(-1px);
}

.save-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7ff;
  color: #536078;
  font-size: 12px;
  line-height: 1.5;
}

#fPhoto {
  width: 100%;
  padding: 10px;
  border: 1px dashed #b9c2d5;
  border-radius: 10px;
  background: #fafbfe;
}

/* Save result feedback */
.toast.success { border: 1px solid #39d98a; }
.toast.error { border: 1px solid #ff5b6e; }
.toast.info { border: 1px solid rgba(255,255,255,.22); }

.success-text { color: #75e39a !important; }
.error-text { color: #ff8c8c !important; }
