:root {
  --bg: #fdf3f6;
  --card-bg: #ffffff;
  --text: #3a2e34;
  --text-muted: #9a8a92;
  --border: #f3dfe6;
  --accent: #e8829f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #201a1e;
    --card-bg: #2b2329;
    --text: #f5eef1;
    --text-muted: #a99aa1;
    --border: #3a2f35;
  }
}

:root[data-theme="light"] {
  --bg: #fdf3f6;
  --card-bg: #ffffff;
  --text: #3a2e34;
  --text-muted: #9a8a92;
  --border: #f3dfe6;
}

:root[data-theme="dark"] {
  --bg: #201a1e;
  --card-bg: #2b2329;
  --text: #f5eef1;
  --text-muted: #a99aa1;
  --border: #3a2f35;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* --- Theme switch --- */
.theme-toggle-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.theme-switch input:checked + .theme-switch-track {
  background: var(--accent);
}

.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
  transform: translateX(20px);
}

/* --- Login --- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
  text-align: center;
}

.login-card .subtitle {
  margin: 0 0 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-card input {
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.login-card input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.login-card button {
  margin-top: 8px;
  padding: 11px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.login-card button:hover { opacity: 0.92; }

.login-card .error {
  background: rgba(232, 130, 159, 0.15);
  color: var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  text-align: center;
}

/* --- Dashboard --- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 8px;
}

.top h1 {
  font-size: 22px;
  margin: 0;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
}

.logout:hover { color: var(--text); }

.grid {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  box-shadow: 0 2px 10px rgba(232, 130, 159, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(232, 130, 159, 0.16);
}

.card-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.card-body h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.card-body p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-url {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.card-go {
  align-self: center;
  text-align: center;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: var(--card-accent, var(--accent));
  margin-top: auto;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.card:hover .card-go {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  filter: brightness(1.06);
}

/* --- Love wish modal --- */
.love-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 46, 52, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1000;
}

.love-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.love-card {
  width: 100%;
  max-width: 360px;
  background: var(--card-bg);
  border-radius: 22px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.85) translateY(10px);
  transition: transform 0.25s ease;
}

.love-overlay.visible .love-card {
  transform: scale(1) translateY(0);
}

.love-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  animation: love-pulse 1.2s ease-in-out infinite;
}

.love-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes love-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.love-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 22px;
  line-height: 1.5;
}

.love-continue {
  border: none;
  border-radius: 999px;
  padding: 11px 24px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.love-continue:hover { filter: brightness(1.05); }
