@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&family=Great+Vibes&family=Dancing+Script:wght@600&family=Parisienne&family=Sacramento&display=swap');

:root {
  --bg: #fdf6f0;
  --card: #fbeaea;
  --accent: #f7c8d1;
  --text: #5c4b4b;
  --shadow-light: #ffffff;
  --shadow-dark: #e0c9c9;
  --font-message: 'Great Vibes', cursive;
  --danger: #e07a7a;
}

body.theme-blush        { --font-message: 'Great Vibes', cursive; }
body.theme-cream        { --bg:#faf6ee; --card:#f3e9d8; --accent:#e6c9a8; --shadow-dark:#d8c8ae; --font-message:'Dancing Script',cursive; }
body.theme-rosewater    { --bg:#fbeef0; --card:#f6d9de; --accent:#eab3bd; --shadow-dark:#dba8b2; --font-message:'Parisienne',cursive; }
body.theme-lavenderpink { --bg:#f7f0f7; --card:#ecdcf0; --accent:#d9b8e6; --shadow-dark:#c9a8d8; --font-message:'Sacramento',cursive; }

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

/* ── centred layout (login, index) ── */
.clay-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* ── card ── */
.clay-card {
  background: var(--card);
  border-radius: 30px;
  padding: 40px 30px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}

/* ── typography ── */
.calligraphy {
  font-family: var(--font-message);
  font-size: 2.8em;
  color: var(--text);
  margin-bottom: 20px;
}
.wordmark {
  font-family: 'Great Vibes', cursive;
  font-size: 2em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ── inputs ── */
.clay-input {
  width: 100%;
  padding: 14px 18px;
  margin: 10px 0;
  border: none;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  font-family: 'Poppins', sans-serif;
  font-size: 1em;
  color: var(--text);
  outline: none;
}
.clay-input::placeholder { opacity: 0.6; }

/* ── buttons ── */
.clay-btn {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  border: none;
  border-radius: 20px;
  background: var(--accent);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.05em;
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  cursor: pointer;
  transition: transform 0.15s;
}
.clay-btn:active  { transform: scale(0.96); }
.clay-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.clay-btn.secondary {
  background: var(--bg);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}
.clay-btn.danger { background: #f5d0d0; }

/* ── messages ── */
.clay-msg   { font-size: 0.95em; color: var(--danger); min-height: 1.2em; margin-top: 8px; }
.clay-ok    { color: #7aa87a; }

.clay-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; font-family: 'Poppins', sans-serif; color: var(--text);
  gap: 8px;
}

/* ── password row ── */
.pw-row { display: flex; align-items: center; gap: 8px; }
.pw-row .clay-input { margin: 10px 0; }
.eye-btn {
  flex-shrink: 0; border: none; background: var(--card);
  border-radius: 14px; width: 46px; height: 46px; font-size: 1.1em;
  cursor: pointer;
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}
.eye-btn:active { transform: scale(0.95); }

/* ── nav buttons ── */
.nav-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-top: 25px;
}
.nav-btn {
  padding: 10px 18px; border-radius: 16px; background: var(--card);
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  font-size: 1.05em; text-decoration: none; color: var(--text); font-weight: 600;
  border: none; cursor: pointer; font-family: 'Poppins', sans-serif;
  transition: transform 0.12s;
}
.nav-btn:active { transform: scale(0.96); }
.nav-btn.active { background: var(--accent); }

/* ── page shell ── */
.page-shell { min-height: 100vh; padding-bottom: 60px; }

.top-nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 14px 16px;
  background: var(--card);
  box-shadow: 0 4px 12px var(--shadow-dark);
  position: sticky; top: 0; z-index: 10;
}
.top-nav .brand {
  font-family: var(--font-message);
  font-size: 1.6em; color: var(--accent);
  margin-right: auto; text-decoration: none;
}
.top-nav .nav-btn { padding: 8px 14px; font-size: 0.9em; }

.page-content { max-width: 800px; margin: 0 auto; padding: 24px 16px; }

.page-card {
  background: var(--card); border-radius: 30px; padding: 28px 24px;
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  margin-bottom: 24px;
}
.page-title {
  font-size: 1.3em; font-weight: 600;
  margin: 0 0 18px; color: var(--text);
}

/* ── 4-digit PIN pad ── */
.pin-display {
  display: flex; gap: 12px; justify-content: center; margin: 20px 0;
}
.pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  transition: background 0.2s;
}
.pin-dot.filled { background: var(--accent); box-shadow: none; }

.pin-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin: 0 auto; max-width: 260px;
}
.pin-key {
  padding: 18px 10px; border: none; border-radius: 18px;
  background: var(--card); color: var(--text);
  font-family: 'Poppins', sans-serif; font-size: 1.3em; font-weight: 600;
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  cursor: pointer; transition: transform 0.12s;
}
.pin-key:active { transform: scale(0.92); }
.pin-key.wide { grid-column: span 2; }
.pin-key.del  { background: var(--bg); }

/* ── floating hearts ── */
@keyframes floatHeart {
  0%   { transform: translateY(0) scale(1); opacity: 0.7; }
  100% { transform: translateY(-80px) scale(1.4); opacity: 0; }
}
.heart-float {
  position: fixed; pointer-events: none; font-size: 1.4em;
  animation: floatHeart 1.4s ease-out forwards;
  z-index: 999;
}

/* ── video timeline ── */
.timeline { display: flex; flex-direction: column; gap: 20px; }

.note-card {
  background: var(--bg); border-radius: 24px; padding: 14px;
  box-shadow: inset 3px 3px 8px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light);
  position: relative;
}
.note-video {
  width: 100%; max-width: 320px; border-radius: 18px;
  display: block; margin: 0 auto;
  box-shadow: 4px 4px 10px var(--shadow-dark);
  background: #000;
}
.note-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding: 0 4px;
}
.note-date   { font-size: 0.82em; opacity: 0.7; }
.note-person {
  font-size: 0.82em; font-weight: 600;
  background: var(--accent); padding: 3px 12px; border-radius: 12px;
}
.note-heart { position: absolute; top: 12px; right: 16px; font-size: 1.3em; cursor: pointer; }

.empty-state { text-align: center; opacity: 0.65; padding: 30px 0; font-size: 1.05em; }

/* ── recording controls ── */
#cameraPreview, #playbackPreview {
  width: 100%; max-width: 320px; border-radius: 20px; background: #000;
  display: block; margin: 0 auto 16px;
  box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
  aspect-ratio: 9/16; object-fit: cover;
}
.record-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.record-controls .clay-btn { width: auto; padding: 12px 22px; }
#recTimer {
  text-align: center; font-weight: 600; color: var(--danger);
  min-height: 1.4em; margin-bottom: 10px; font-size: 1.05em;
}

/* ── admin panel ── */
.admin-section { margin-bottom: 28px; }
.admin-label   { font-size: 0.9em; font-weight: 600; opacity: 0.75; margin-bottom: 6px; display: block; text-align: left; }
select.clay-input { cursor: pointer; }

/* ── home daily message ── */
.daily-msg-wrap {
  padding: 10px 0 20px;
}
.daily-msg {
  font-family: var(--font-message);
  font-size: 2.2em;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
  min-height: 1.4em;
  transition: opacity 0.4s ease;
}

/* ── misc decorations ── */
.heart-divider { text-align: center; letter-spacing: 8px; font-size: 1.1em; opacity: 0.5; margin: 8px 0 20px; }

/* ── responsive ── */
@media (max-width: 480px) {
  .clay-card { padding: 32px 20px; }
  .page-card { padding: 20px 16px; }
  .top-nav .brand { font-size: 1.3em; }
}
