/* Shared styles — Link Maker (profile builder + public profile page).
   Palette matches the main W2Taps brand system so this feels like the
   same product family, not a Linktree clone. */

:root {
  --ink: #14161B;
  --ink-soft: #1C1F26;
  --signal: #3ED9C4;
  --brass: #B98D4E;
  --bone: #F5F2EC;
  --line: rgba(245, 242, 236, 0.12);
  --wp-brand: #3ED9C4;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  min-height: 100vh;
}

h1, h2, h3, .serif { font-family: 'Fraunces', Georgia, serif; }
.mono { font-family: 'Space Mono', monospace; }

a { color: inherit; }

/* ---------- layout shell used by index.html (builder) ---------- */

.builder-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.builder-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
}

.builder-topbar .logo {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}
.builder-topbar .logo span { color: var(--signal); }

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

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

.panel {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}
.panel .hint {
  margin: 0 0 18px;
  color: rgba(245,242,236,0.6);
  font-size: 0.88rem;
  line-height: 1.5;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(245,242,236,0.55);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="tel"],
.field textarea,
.field select {
  width: 100%;
  background: rgba(245,242,236,0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--bone);
  font-size: 0.95rem;
  font-family: inherit;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--signal);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] {
  width: 44px; height: 40px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: none; cursor: pointer;
}
.color-field .hex { font-family: 'Space Mono', monospace; font-size: 0.85rem; color: rgba(245,242,236,0.7); }

.link-row {
  display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
}
.link-row input { flex: 1; }
.link-row button {
  background: rgba(255,80,80,0.12);
  border: 1px solid rgba(255,80,80,0.3);
  color: #ff9c9c;
  border-radius: 8px;
  width: 34px; height: 34px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--signal); color: #05201c; }
.btn-secondary { background: transparent; border: 1px solid var(--line); color: var(--bone); }
.btn-ghost { background: rgba(245,242,236,0.06); color: var(--bone); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

.status-msg {
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 10px;
}
.status-msg.ok { background: rgba(62,217,196,0.12); color: var(--signal); }
.status-msg.err { background: rgba(255,80,80,0.12); color: #ff9c9c; }
.status-msg.info { background: rgba(245,242,236,0.06); color: rgba(245,242,236,0.75); }

.slug-preview {
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  color: rgba(245,242,236,0.6);
  margin-top: 6px;
  word-break: break-all;
}

.preview-sticky { position: sticky; top: 20px; }
.preview-frame-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(245,242,236,0.5);
  margin-bottom: 10px;
}
.preview-window {
  background: #0c0d10;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  max-height: 78vh;
  overflow-y: auto;
  mask-image: linear-gradient(to bottom, transparent, black 18px, black calc(100% - 18px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 18px, black calc(100% - 18px), transparent);
}

.publish-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(62,217,196,0.08);
  border: 1px solid rgba(62,217,196,0.3);
}
.publish-result .link-row-static {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.25); border-radius: 8px; padding: 8px 10px; margin: 8px 0;
  font-family: 'Space Mono', monospace; font-size: 0.82rem; word-break: break-all;
}
.publish-result img.qr { border-radius: 10px; margin-top: 10px; background: #fff; padding: 8px; }

/* ---------- the actual rendered profile (shared) ----------
   Full-bleed, longer-form, link-in-bio style page. Background and
   text colour are driven entirely by CSS variables set inline per
   profile (--wp-bg / --wp-fg etc), computed in profile-render.js so
   text always stays readable against whatever colour the business
   picks. */

.wp-profile {
  background: var(--wp-bg);
  color: var(--wp-fg);
  font-family: 'Inter', sans-serif;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  animation: wp-fade-in 0.4s ease both;
}
@keyframes wp-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.wp-inner {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 64px 28px 32px;
  flex: 1;
}

.wp-header {
  text-align: center;
  margin-bottom: 8px;
}

.wp-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 22px;
  background: rgba(128,128,128,0.15);
}
.wp-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wp-avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 600;
  color: var(--wp-fg);
  background: rgba(128,128,128,0.18);
}

.wp-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 4px;
}
.wp-tagline {
  margin: 0 0 28px;
  color: var(--wp-fg-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.wp-section { margin-bottom: 28px; }

.wp-about {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--wp-fg-muted);
  text-align: center;
}

.wp-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wp-linkbtn {
  display: block;
  text-align: center;
  padding: 17px 20px;
  border-radius: 999px;
  background: var(--wp-btn-bg);
  text-decoration: none;
  color: var(--wp-btn-fg);
  font-size: 0.98rem;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}
.wp-linkbtn:hover {
  transform: translateY(-2px);
  background: var(--wp-btn-bg-hover);
}

.wp-socials {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0 6px;
}
.wp-social {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wp-fg);
  opacity: 0.85;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.wp-social:hover { transform: translateY(-2px); opacity: 1; }

.wp-hours-title {
  text-align: center;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wp-fg-muted);
  margin-bottom: 8px;
}
.wp-hours-body {
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--wp-fg-muted);
}

.wp-backdrop {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  margin-top: auto;
}
.wp-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wp-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--wp-bg) 0%, rgba(0,0,0,0) 35%);
}

/* Fallback when there's no chosen cover photo: a small, quiet logo
   watermark instead of a full-bleed banner — sits at the bottom, low
   opacity, contained size, so it reads as a subtle sign-off rather than
   a photo that might not suit the page. */
.wp-backdrop-logo {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.32;
}
.wp-backdrop-logo img {
  width: auto;
  height: 56px;
  object-fit: contain;
}
.wp-backdrop-logo::before {
  content: none;
}

.wp-footer {
  text-align: center;
  padding: 14px 20px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--wp-fg-muted);
  opacity: 0.55;
}

/* ---------- full-page view.html wrapper ---------- */
/* The background colour is set by the profile itself (--wp-bg fills
   .wp-profile edge-to-edge), so the outer shell stays a plain,
   unstyled full-height wrapper rather than a card floating on a
   different-coloured page. */

.view-shell {
  min-height: 100vh;
}

.view-loading, .view-empty {
  text-align: center;
  padding: 80px 20px;
  color: rgba(245,242,236,0.6);
}

/* ---------- builder: colour swatches ---------- */

.swatch-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(245,242,236,0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.swatch:hover { transform: scale(1.12); border-color: var(--signal); }
.swatch-row { flex-wrap: wrap; }

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .builder-shell { padding: 20px 14px 60px; }
  .panel { padding: 16px; border-radius: 14px; }
  .field-row { flex-direction: column; gap: 0; }
  .builder-topbar { gap: 8px; }
  .builder-topbar .btn { font-size: 0.82rem; padding: 9px 12px; }
  .preview-window { max-height: 60vh; }
  #loginPanel { margin: 24px auto !important; max-width: 100% !important; }
}

@media (max-width: 420px) {
  .wp-inner { padding: 40px 18px 28px; }
  .wp-name { font-size: 1.2rem; }
  .wp-avatar { width: 80px; height: 80px; margin: 0 auto 18px; }
  .wp-linkbtn { padding: 15px 18px; font-size: 0.92rem; }
  .wp-socials { gap: 16px; margin: 24px 0 4px; }
  .wp-backdrop { height: 160px; }
  .wp-backdrop-logo { height: 64px; }
  .wp-backdrop-logo img { height: 40px; }
}
