:root {
  /* Modern Brand Palette */
  --brand-blue: #0a305a;
  --brand-purple: #7f5ca3;
  --brand-accent: #a389bf;

  /* Modern Theme Colors */
  --primary: var(--brand-blue);
  --secondary: var(--brand-purple);
  --accent: var(--brand-accent);

  --bg-gradient-start: #f3f4f6;
  --bg-gradient-end: #e5e7eb;

  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-light: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;

  --font-display: "Red Hat Display", sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-display);
  background: var(--bg-gradient-start);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background Animations */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
  animation: float 20s infinite alternate;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-accent));
  top: -100px;
  left: -100px;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(30px, 50px) rotate(10deg);
  }
}

/* App Wrapper */
.app-wrapper {
  width: 100%;
  max-width: 600px; /* Slightly wider for better breathing room */
  padding: 20px;
  perspective: 1000px;
}

/* Glass Panel Card */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  transition: var(--transition-smooth);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* Header */
.card-header {
  text-align: center;
  margin-bottom: 40px;
}

.logo-container {
  margin-bottom: 24px;
}

.brand-logo {
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Service Selection Grid */
.selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.selection-card {
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
  display: flex; /* Fix alignment */
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.selection-card:hover {
  background: #fff;
  border-color: var(--brand-purple);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.selection-card .icon-wrapper {
  width: 100%;
  height: 200px; /* Taller to act as cover */
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.selection-card .icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.selection-card:hover .icon-wrapper {
  transform: scale(1.02);
  background: var(--brand-purple);
}

.selection-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brand-blue);
}

/* Form Styles */
.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-control {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  background: #ffffff; /* Solid white for better contrast */
  border: 1px solid rgba(0, 0, 0, 0.1); /* Subtle definition */
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
  color: var(--text-main);
  font-family: inherit;
}

.form-control::placeholder {
  color: transparent;
}

.form-control:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 4px rgba(127, 92, 163, 0.1);
}

.form-label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
  padding: 0 4px;
  background: transparent;
}

/* Floating Label Logic */
.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
  transform: translateY(-28px) scale(0.85);
  left: 8px;
  color: var(--brand-purple);
  font-weight: 600;
  background: var(--glass-bg); /* Match container bg roughly */
  border-radius: 4px;
}

.required {
  color: #ef4444;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(10, 48, 90, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 48, 90, 0.3);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  transition: var(--transition-smooth);
  font-weight: 500;
}

.btn-text:hover {
  color: var(--brand-blue);
  transform: translateX(-4px);
}

/* Status Messages */
.status-message {
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.status-message.success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.status-message.error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .app-wrapper {
    padding: 16px;
  }

  .glass-panel {
    padding: 24px;
  }

  .selection-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.75rem;
  }

  .bg-shape {
    opacity: 0.4; /* Don't distract on small screens */
  }
}

/* Admin Layout Overrides */
.admin-layout {
  width: 100%;
  max-width: 1200px;
  padding: 20px;
}

.auth-container {
  max-width: 400px;
  width: 100%;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.tab {
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: var(--transition-smooth);
  margin-bottom: -2px;
}

.tab:hover {
  color: var(--brand-blue);
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px 8px 0 0;
}

.tab.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

/* Tables */
.table-container {
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th {
  text-align: left;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-blue);
  font-weight: 700;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: top;
  color: var(--text-main);
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.6);
}

/* Status Pills */
.status-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-Burial {
  background: #ede9fe; /* Light violet */
  color: #5b21b6;
}

.status-Cremation {
  background: #dcfce7; /* Light green */
  color: #166534;
}

/* Admin Actions */
.admin-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.4);
  padding: 16px;
  border-radius: var(--radius-sm);
}

.filter-group {
  display: flex;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

.filter-input {
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
}

.question-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: var(--transition-smooth);
}

.question-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.question-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-smooth);
  display: inline-flex; /* align icon */
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05); /* Make hover subtle */
  color: var(--brand-blue);
  transform: scale(1.1);
}

.btn-icon.delete:hover {
  color: #ef4444;
  background: #fee2e2;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
}
