/* HeartLock — shared light design tokens & primitives */

:root {
  /* Surface */
  --bg:           #fff7f9;
  --bg-soft:      #fbecf1;
  --bg-warm:      #fff1ea;
  --surface:      #ffffff;
  --surface-2:    #fdf5f7;
  --surface-3:    #f7e8ee;

  /* Text */
  --text:         #3c2533;
  --text-soft:    #6b4f5f;
  --text-mute:    #9a8694;

  /* Brand */
  --rose:         #db4d7a;
  --rose-soft:    #ff6f9c;
  --rose-deep:    #b1335f;
  --peach:        #ffb088;
  --lavender:     #b288e0;
  --sage:         #8ec3a3;

  --accent:       var(--rose);
  --accent-2:     var(--lavender);
  --accent-soft:  #fde2ec;

  --warn:         #d05757;
  --ok:           #2e9d6e;

  --border:       #f3dde6;
  --border-2:     #e8c9d6;
  --border-soft:  #f7e5ec;

  --shadow-soft:  0 6px 24px rgba(219, 77, 122, 0.10), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-card:  0 10px 32px rgba(219, 77, 122, 0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 16px 40px rgba(219, 77, 122, 0.18), 0 6px 18px rgba(0,0,0,0.08);

  --radius-sm:    10px;
  --radius:       16px;
  --radius-lg:    24px;
  --radius-xl:    32px;

  --grad-warm:    linear-gradient(135deg, #fff7f9 0%, #ffe8ef 50%, #ffe1d5 100%);
  --grad-rose:    linear-gradient(135deg, #ff6f9c 0%, #db4d7a 60%, #b1335f 100%);
  --grad-soft:    linear-gradient(135deg, #ffe8ef 0%, #fde2ec 100%);
  --grad-hero:    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(255,176,200,0.45), transparent 60%),
                  radial-gradient(ellipse 80% 50% at 90% 80%, rgba(178,136,224,0.30), transparent 60%),
                  linear-gradient(180deg, #fff7f9 0%, #ffeef3 100%);

  --font-body:   -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  --font-display:'New York', 'Iowan Old Style', 'Palatino', 'Hoefler Text', 'Georgia', serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--rose); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--rose-deep); }

/* Typography */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }
p  { margin: 0; }
.muted     { color: var(--text-soft); }
.muted-deep{ color: var(--text-mute); }
.small     { font-size: .875rem; }
.tiny      { font-size: .75rem; }
.center    { text-align: center; }
.hidden    { display: none !important; }

/* Container */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.1;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--grad-rose);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn.primary:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.btn.ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border-2);
}
.btn.ghost:hover { color: var(--text); border-color: var(--rose); background: var(--surface-2); }
.btn.outline {
  background: var(--surface);
  color: var(--rose);
  border-color: var(--rose);
}
.btn.outline:hover { background: var(--accent-soft); }
.btn.danger {
  background: transparent;
  color: var(--warn);
  border-color: rgba(208,87,87,0.35);
}
.btn.danger:hover { background: rgba(208,87,87,0.08); }
.btn.block { width: 100%; }
.btn.small { padding: 10px 16px; font-size: .85rem; }
.btn.large { padding: 18px 32px; font-size: 1.05rem; }

/* Inputs */
.input, input[type="text"], input[type="password"], input[type="email"], input[type="datetime-local"], input[type="date"], textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  padding: 14px 16px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.input:focus, input:focus, textarea:focus, select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
label.field-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1; min-width: 120px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.card-warm {
  background: var(--grad-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
}

/* Top bar (used by app + auth) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,247,249,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; }
.brand .b-accent { color: var(--rose); }

.nav-links {
  display: none;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: .95rem;
}
.nav-links a:hover { color: var(--rose); background: var(--accent-soft); }
.nav-actions { display: flex; gap: 8px; align-items: center; }
@media (min-width: 768px) {
  .nav-links { display: inline-flex; }
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 40px 0 30px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a {
  color: var(--text-soft); font-size: .9rem;
}
.footer-links a:hover { color: var(--rose); }
.footer-note { color: var(--text-mute); font-size: .85rem; }

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 1000;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #ffe9e9; border-color: #ffcaca; color: #7d2727; }
.toast.success { background: #e3f7ec; border-color: #b8e7c7; color: #1f6b48; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(60, 37, 51, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 800;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px; width: 100%;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 16px;
  animation: pop .2s ease;
}
.modal h3 { font-family: var(--font-display); font-size: 1.35rem; margin: 0; }
.modal p  { color: var(--text-soft); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .btn { min-width: 120px; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop    { from { opacity: 0; transform: scale(.95) } to { opacity: 1; transform: scale(1) } }

/* Icons (Font Awesome integration) */
.fa-icon { color: var(--rose); }
i.fas, i.far, i.fab { line-height: 1; }

/* Utility */
.hstack { display: flex; align-items: center; gap: 10px; }
.vstack { display: flex; flex-direction: column; gap: 12px; }
.grow   { flex: 1; }
.spacer-sm { height: 10px; }
.spacer    { height: 24px; }
.spacer-lg { height: 48px; }

/* Soft focus rings for keyboard */
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 6px; }

/* Selection */
::selection { background: var(--accent-soft); color: var(--rose-deep); }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-help  { font-size: .8rem; color: var(--text-mute); }

.checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .9rem;
  color: var(--text-soft);
  line-height: 1.4;
}
.checkbox-row input[type=checkbox] {
  margin: 0;
  width: 18px; height: 18px;
  accent-color: var(--rose);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Tooltip-ish badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft);
  color: var(--rose-deep);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.badge.green { background: #e0f4ea; color: var(--ok); }
.badge.warn  { background: #fff0e1; color: #b86b2d; }
