/* ---------- Base ---------- */

:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* LTM brand palette (from ltm.com). Coral is the logo colour; buttons use the deeper red so white text stays readable. */
  --ltm-coral: #ff5e4f;
  --ltm-red: #dc3535;
  --ltm-red-dark: #b02a2a;
  --ltm-coral-tint: #ffdfdc;
  --ltm-carbon: #1a1a1a;
  --ltm-purple: #482475;
  --ltm-cover: linear-gradient(120deg, var(--ltm-coral), var(--ltm-red-dark) 45%, #2b1249); /* when no cover image is uploaded */
  --ink: var(--ltm-carbon);
  --muted: #6b6f76;
  --line: #e4e6ea;
  --bg: #f4f5f7;
  --danger: #c62828;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ltm-red);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.small {
  font-size: 14px;
}

.center {
  text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-primary {
  background: var(--ltm-red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ltm-red-dark);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 17px;
}

.btn-small {
  padding: 6px 14px;
  border-color: #d5d8dd;
  font-size: 14px;
}

.btn-small:hover {
  background: #f4f5f7;
}

.btn-light {
  background: rgba(255, 255, 255, 0.94);
  color: #111;
}

.btn-light:hover {
  background: #fff;
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.btn-danger {
  color: var(--danger);
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 22px;
}

/* "LTM | QR Cards" */
.brand span {
  padding-left: 11px;
  border-left: 1px solid #c9ccd1;
  line-height: 22px;
}

.topbar-link {
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Dark scene with LTM coral glow (QR page + home demo) ---------- */

.qr-scene {
  position: relative;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(55% 45% at 0% 28%, rgba(255, 94, 79, 0.3), transparent 70%),
    radial-gradient(45% 40% at 100% 62%, rgba(220, 53, 53, 0.24), transparent 70%),
    radial-gradient(80% 50% at 50% 115%, rgba(72, 36, 117, 0.55), transparent 70%),
    #000;
}

.qr-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 126, 114, 0.6) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 126, 114, 0.3) 0 1.6px, transparent 2.4px);
  background-size: 23px 23px, 67px 67px;
  background-position: 0 0, 13px 29px;
  -webkit-mask-image: radial-gradient(60% 55% at 8% 35%, #000, transparent 70%), radial-gradient(50% 45% at 96% 60%, #000, transparent 70%);
  mask-image: radial-gradient(60% 55% at 8% 35%, #000, transparent 70%), radial-gradient(50% 45% at 96% 60%, #000, transparent 70%);
}

/* ---------- Avatar (shared by profile + QR card) ---------- */

.profile-avatar,
.qr-card-avatar {
  position: relative;
  aspect-ratio: 1;
  container-type: inline-size;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #d9dce1;
}

.avatar-initials {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3a3a3a, #101010);
  color: #fff;
  font-size: 40px;
  font-size: 34cqw;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar-logo {
  position: absolute;
  right: -14%;
  bottom: 3%;
  display: grid;
  place-items: center;
  width: 38%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.avatar-logo img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

/* ---------- QR card ---------- */

.qr-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border: 1px solid #333;
  border-radius: 10px;
  background: var(--ltm-carbon);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 10px 24px rgba(255, 94, 79, 0.1),
    0 30px 70px rgba(0, 0, 0, 0.65);
}

.qr-card-cover {
  height: 76px;
  background: var(--ltm-cover);
}

/* LTM logo in the space beside the avatar, just under the cover. */
.qr-card-brand {
  position: absolute;
  top: 94px;
  right: 9%;
  width: auto;
  height: 18px;
}

.qr-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-card-avatar {
  width: 112px;
  margin: -64px 0 0 9%;
}

.qr-card-avatar .avatar-logo {
  right: -8%;
  bottom: 0;
  width: 34%;
}

.qr-card-info {
  padding: 14px 9% 0;
}

.qr-card-info h1 {
  margin-bottom: 6px;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.qr-card-info p {
  color: #f3f3f3;
  font-size: 18px;
  line-height: 1.4;
}

.qr-card-info .qr-card-location {
  margin-top: 2px;
  color: #a3a3a3;
  font-size: 15px;
}

.qr-box {
  display: block;
  margin: 30px 6.5% 28px;
  padding: 40px 20px 24px;
  border: 1px solid #4a4a4a;
  color: #fff;
  text-align: center;
  text-decoration: none;
}

.qr-code {
  width: 74%;
  margin: 0 auto 22px;
}

.qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-box p {
  font-size: 18px;
  font-weight: 500;
}

/* ---------- QR page ---------- */

.page-qr {
  min-height: 100vh;
  min-height: 100dvh;
}

.qr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 452px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 16px max(48px, env(safe-area-inset-bottom));
}

.qr-stage > * {
  width: 100%;
}

.notice {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 15px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.notice-warn {
  border-color: rgba(255, 190, 60, 0.45);
  background: rgba(255, 190, 60, 0.13);
}

.notice a {
  color: #fff;
  font-weight: 600;
}

.notice code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.92em;
}

.owner-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.qr-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 15px;
}

.qr-links a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.qr-links a:hover {
  text-decoration: underline;
}

.owner-box {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.owner-box h2 {
  margin-bottom: 6px;
  font-size: 16px;
}

.owner-box p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.copy-field {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.copy-field input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: 13px ui-monospace, Menlo, Consolas, monospace;
}

.copy-field button {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.owner-box .owner-stat strong {
  color: #fff;
  font-size: 18px;
}

/* ---------- Profile (the page a scan opens) ---------- */

.page-profile {
  background: #fff;
}

.profile {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  color: #000;
}

.profile-cover {
  aspect-ratio: 2.6;
  background: var(--ltm-cover);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-head {
  padding: 0 9%;
}

.profile-avatar {
  width: 51%;
  margin-top: -27%;
}

.profile-avatar .avatar-img {
  border: 5px solid #fff;
}

.profile-body {
  flex: 1;
  padding: 26px 9% 20px;
}

.profile-name {
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.profile-title {
  color: #333;
  font-size: 21px;
  line-height: 1.38;
}

.profile-location {
  margin-top: 14px;
  color: #333;
  font-size: 17px;
}

.btn-save-contact {
  display: block;
  margin: 30px 0 22px;
  padding: 17px;
  border-radius: 999px;
  background: var(--ltm-red);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(220, 53, 53, 0.3);
}

.btn-save-contact:active {
  transform: scale(0.99);
}

.profile-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-links a {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 0;
  color: #111;
  font-size: 18px;
  text-decoration: none;
}

.profile-links a span {
  overflow-wrap: anywhere;
}

.profile-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 28px;
}

.profile-brand {
  width: auto;
  height: 16px;
}

.profile-footer a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: #f2f3f5;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Link icons (app-icon style tiles) ---------- */

.link-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 13px;
  color: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.16);
}

.link-icon svg {
  width: 56%;
  height: 56%;
}

.icon-linkedin { background: #2867b2; }
.icon-linkedin svg { width: 66%; height: 66%; }
.icon-website { background: #fff; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.16), inset 0 0 0 1px #ececec; }
.icon-website svg { width: 78%; height: 78%; }
.icon-phone { background: linear-gradient(#6ee865, #23b532); }
.icon-whatsapp { background: linear-gradient(#5ef67b, #26b53c); }
.icon-whatsapp svg { width: 62%; height: 62%; }
.icon-email { background: linear-gradient(#2a9bff, #0a62e0); }
.icon-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.icon-x { background: #000; }
.icon-x svg { width: 48%; height: 48%; }
.icon-facebook { background: #1877f2; }
.icon-github { background: #181717; }
.icon-youtube { background: #fff; color: #f00; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.16), inset 0 0 0 1px #ececec; }
.icon-youtube svg { width: 64%; height: 64%; }
.icon-telegram { background: linear-gradient(#3fb5ea, #1e93cc); }
.icon-tiktok { background: #000; }
.icon-link { background: linear-gradient(#94949a, #626268); }

/* ---------- Home ---------- */

.page-home {
  background: #fff;
}

.home {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 64px;
}

.home-hero h1 {
  margin-bottom: 20px;
  font-size: clamp(38px, 5.4vw, 62px);
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.home-hero h1 em {
  color: var(--ltm-red);
  font-style: normal;
}

.lead {
  max-width: 34em;
  margin-bottom: 28px;
  color: #444;
  font-size: 19px;
}

.steps {
  display: grid;
  gap: 18px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 14px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ltm-coral-tint);
  color: var(--ltm-red-dark);
  font-weight: 700;
}

.steps span {
  color: var(--muted);
  font-size: 15px;
}

.home-demo {
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 48px 24px;
  border-radius: 28px;
}

.home-demo .qr-card {
  max-width: 380px;
}

@media (max-width: 860px) {
  .home {
    grid-template-columns: 1fr;
  }
}

/* ---------- Editor ---------- */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 48px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 40px) 64px;
}

.editor-form h1 {
  font-size: 32px;
  letter-spacing: -0.02em;
}

.editor-form > .muted {
  margin: 6px 0 24px;
}

.panel {
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.panel h2 {
  margin-bottom: 14px;
  font-size: 17px;
}

.panel > .muted {
  margin: -8px 0 14px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.field em {
  color: var(--danger);
  font-style: normal;
}

.field input,
.link-row input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d5d8dd;
  border-radius: 10px;
  background: #fff;
  font-size: 16px; /* 16px stops iOS zooming on focus */
}

.field input:focus,
.link-row input:focus {
  border-color: #111;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.image-field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.panel h2 + .image-field {
  padding-top: 0;
  border-top: 0;
}

.image-thumb {
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px dashed #c4c8ce;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9aa0a6;
  font-size: 24px;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb-logo {
  background: #fff;
}

.image-thumb-logo img {
  padding: 8px;
  object-fit: contain;
}

.image-thumb-cover {
  width: 120px;
  height: 48px;
  border-radius: 10px;
}

.has-image .image-thumb {
  border-style: solid;
  border-color: var(--line);
}

.has-image .image-empty {
  display: none;
}

.image-meta {
  display: flex;
  flex-direction: column;
}

.image-meta small {
  color: var(--muted);
  font-size: 13px;
}

.image-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.link-rows {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.link-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.link-row .link-icon {
  width: 44px;
  height: 44px;
  margin-top: 2px;
  border-radius: 11px;
}

.link-row-fields {
  display: grid;
  gap: 6px;
}

.link-row input[data-field='label'] {
  padding: 7px 12px;
  border-color: transparent;
  background: #f4f5f7;
  font-size: 16px;
}

.link-row.invalid input[data-field='value'] {
  border-color: var(--danger);
}

.link-error {
  color: var(--danger);
  font-size: 13px;
}

.link-row-actions {
  display: flex;
  gap: 4px;
}

.link-row-actions button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #444;
  cursor: pointer;
}

.link-row-actions button:hover:not(:disabled) {
  background: #f4f5f7;
}

.link-row-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.chip:hover {
  border-color: #b9bdc3;
}

.chip .link-icon-sm {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  box-shadow: none;
}

.editor-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: 8px;
}

.form-error {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdecea;
  color: #b71c1c;
  font-size: 15px;
}

.editor-preview {
  position: sticky;
  top: 24px;
}

.phone {
  max-width: 380px;
  margin: 0 auto 12px;
  padding: 11px;
  border-radius: 46px;
  background: #111;
  box-shadow: inset 0 0 0 2px #3a3a3a, 0 30px 60px rgba(0, 0, 0, 0.18);
}

.phone-screen {
  height: min(760px, calc(100vh - 110px));
  overflow-y: auto;
  border-radius: 36px;
  background: #fff;
  scrollbar-width: none;
}

.phone-screen::-webkit-scrollbar {
  display: none;
}

.phone-screen .profile {
  min-height: 100%;
}

@media (max-width: 960px) {
  .editor {
    grid-template-columns: 1fr;
  }

  .editor-preview {
    position: static;
  }

  .phone-screen {
    height: 640px;
  }
}

@media (max-width: 520px) {
  .panel {
    padding: 18px 16px;
  }

  .link-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .link-row .link-icon {
    width: 40px;
    height: 40px;
  }

  .link-row-actions {
    grid-column: 2;
  }
}

/* ---------- Message pages ---------- */

.message {
  max-width: 480px;
  margin: 10vh auto;
  padding: 0 24px;
  text-align: center;
}

.message-code {
  color: #b0b4ba;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.message h1 {
  margin: 6px 0 10px;
  font-size: 28px;
}

.message .muted {
  margin-bottom: 24px;
}
