/* Serene memorial styling.
   Soft, warm, low-contrast palette intended to feel calm and dignified.
   Fully responsive and optimised for mobile devices. */

:root {
  --bg-top: #f4f1ec;
  --bg-bottom: #e9e4db;
  --surface: #fbfaf7;
  --ink: #3c3a36;
  --ink-soft: #6f6a62;
  --line: #d9d2c6;
  --accent: #8a9a82;        /* muted sage */
  --accent-deep: #6f8066;
  --shadow: rgba(60, 58, 54, 0.12);
  --radius: 18px;
  --maxw: 920px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.veil {
  width: 100%;
  max-width: var(--maxw);
  animation: rise 1.1s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .veil,
  .candle-flame {
    animation: none !important;
  }
}

/* Header / memorial heading */
.memorial-head {
  text-align: center;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.candle {
  width: 26px;
  height: 64px;
  margin: 0 auto 1.25rem;
  position: relative;
}

.candle-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 40px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #fff 0%, #efe7d6 100%);
  box-shadow: 0 2px 6px var(--shadow);
}

.candle-flame {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 20px;
  background: radial-gradient(circle at 50% 70%, #ffd98a 0%, #ff9d3c 60%, rgba(255, 157, 60, 0) 75%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  filter: blur(0.3px);
  animation: flicker 2.6s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-1deg); opacity: 0.95; }
  50%      { transform: translateX(-50%) scale(1.06) rotate(1deg); opacity: 1; }
}

.memorial-title {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}

.memorial-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  margin: 0.2rem 0 0;
  color: var(--accent-deep);
}

.memorial-period {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.divider {
  width: 64px;
  height: 1px;
  margin: 1.4rem auto 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.memorial-message {
  max-width: 36rem;
  margin: 1.2rem auto 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.1rem, 3.4vw, 1.4rem);
  font-style: italic;
  color: var(--ink-soft);
}

/* Card surface */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px var(--shadow);
  padding: clamp(1.5rem, 5vw, 2.75rem);
}

/* Login form */
.login-card {
  max-width: 27rem;
  margin: 0 auto;
  text-align: center;
}

.login-intro {
  color: var(--ink-soft);
  margin: 0 0 1.6rem;
  font-size: 0.98rem;
}

.field {
  text-align: left;
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="password"],
input[type="text"].pw {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 1rem;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="password"]:focus,
input[type="text"].pw:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 154, 130, 0.22);
}

.toggle-visibility {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--accent-deep);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn:hover {
  background: #5f7057;
}

.btn:active {
  transform: translateY(1px);
}

.error {
  margin: 0 0 1.1rem;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  color: #8a4a44;
  background: #f6e9e7;
  border: 1px solid #e6cfcb;
  border-radius: 10px;
}

/* Player */
.player-card {
  padding: clamp(0.75rem, 3vw, 1.25rem);
}

.video-frame {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #1c1b19;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  background: #000;
}

.no-video {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-soft);
}

.video-error {
  margin: 0.85rem 0 0;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #6f5a4a;
  background: #f6f0e8;
  border: 1px solid #e6ddd0;
  border-radius: 10px;
  text-align: center;
}

.footer-note {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.footer-note a {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-note a:hover {
  border-bottom-color: var(--accent);
}
