:root {
  /* Requested Brand Palette */
  --brand-blue: #0a305a; /* Brand color 1 */
  --brand-purple: #7f5ca3; /* Brand color 2 */
  --brand-accent: #a389bf; /* Brand color 3 */
  --brand-light-purple: #bcacd5; /* Brand color 4 */
  --brand-light-blue: #d2cde8; /* Brand color 5 */

  /* Semantic Mappings */
  --primary: var(--brand-blue);
  --secondary: var(--brand-purple);
  --accent: var(--brand-accent);
  --background-base: #f8fafc; /* Clean light background */

  --text-main: #000000; /* Black for body text */
  --text-muted: #000000; /* Enforced black as requested */
  --text-light: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.95); /* More solid for clear clean look */
  --glass-border: rgba(127, 92, 163, 0.2);
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;

  --font-header: "Merriweather", serif;
  --font-display: "Red Hat Display", sans-serif;

  --transition-smooth: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-display);
  background-color: var(--background-base);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background Animations - Solid Colors Only */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
  opacity: 0.15; /* Subtle background presence */
  animation: float 20s infinite alternate;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background-color: var(--brand-light-blue); /* Solid color */
  top: -150px;
  left: -150px;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background-color: var(--brand-light-purple); /* Solid color */
  bottom: -100px;
  right: -100px;
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(20px, 40px);
  }
}

/* App Wrapper */
.app-wrapper {
  width: 100%;
  max-width: 800px;
  padding: 20px;
}

.app-wrapper.admin-layout {
  max-width: 1600px;
}

/* Clean Card Panel */
.glass-panel {
  background: white;
  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.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* Header */
.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-container {
  margin-bottom: 24px;
}

.brand-logo {
  max-width: 200px;
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-header);
  color: var(--brand-blue);
}

h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
}

/* Service Selection Grid */
.selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.selection-card {
  background: white;
  border: 2px solid var(--brand-light-blue);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.selection-card:hover {
  border-color: var(--brand-purple);
  background-color: #fafafa;
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.selection-card .icon-wrapper {
  width: 100%;
  height: 160px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-light-blue); /* Solid bg for images */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.selection-card .icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.selection-card:hover .icon-wrapper img {
  transform: scale(1.05);
}

.selection-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-blue);
}

/* Form Styles */
.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  background: white;
  border: 2px solid var(--brand-light-blue);
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
  color: var(--text-main);
  font-family: var(--font-display);
}

.form-control::placeholder {
  color: transparent;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-blue);
}

.form-label {
  position: absolute;
  left: 14px;
  top: 14px;
  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(-26px) scale(0.9);
  left: 10px;
  color: var(--brand-blue);
  font-weight: 700;
  background: white;
}

.required {
  color: var(--brand-purple); /* Using brand color for required asterisk instead of generic red */
  margin-left: 2px;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
}

.btn-primary {
  background-color: var(--brand-blue);
  color: white;
}

.btn-primary:hover {
  background-color: #0d3c6e; /* Slightly lighter/different shade manually if needed, or just opacity */
  transform: translateY(-2px);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-weight: 600;
  font-family: var(--font-display);
}

.btn-text:hover {
  color: var(--brand-blue);
  text-decoration: underline;
}

/* Status Messages */
.status-message {
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease;
}

.status-message.success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-message.error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@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;
  }
}

/* Admin Layout Overrides */
.admin-layout {
  max-width: 1200px;
}

.auth-container {
  max-width: 440px;
  margin: 0 auto;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--brand-light-blue);
}

.tab {
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition-smooth);
  margin-bottom: -2px;
}

.tab:hover {
  color: var(--brand-blue);
  background-color: #f8fafc;
}

.tab.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
  background-color: white;
}

/* Tables */
.table-container {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-light-blue);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th {
  text-align: left;
  padding: 16px 20px;
  background-color: #f8fafc;
  color: var(--brand-blue);
  font-weight: 800;
  font-family: var(--font-header);
  border-bottom: 2px solid var(--brand-light-blue);
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--brand-light-blue);
  color: var(--text-main);
  vertical-align: top;
}

tr:hover td {
  background-color: #f8fafc;
}

/* Status Pills */
.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-Cemetery {
  background-color: var(--brand-light-purple);
  color: var(--brand-blue);
}

.status-Crematorium {
  background-color: var(--brand-light-blue);
  color: var(--brand-blue);
}

/* Admin Actions */
.admin-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  background-color: white;
  padding: 20px;
  border: 1px solid var(--brand-light-blue);
  border-radius: var(--radius-sm);
}

.filter-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-input {
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-display);
}

.question-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: white;
  border: 1px solid var(--brand-light-blue);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: var(--transition-smooth);
}

.question-item:hover {
  border-color: var(--brand-blue);
  transform: translateX(2px);
}

.question-meta {
  font-size: 0.8rem;
  color: var(--brand-purple);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-muted);
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background-color: #f1f5f9;
  color: var(--brand-blue);
}

.btn-icon.delete:hover {
  background-color: #fef2f2;
  color: #ef4444;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
  width: auto;
}

/* Scale Input Styles */
.scale-container {
  margin-bottom: 24px;
  padding: 10px 0;
}

.scale-group-label {
  display: block;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 700;
}

.scale-options-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  gap: 10px;
  position: relative;
}

.scale-option {
  flex: 1;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scale-option input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.scale-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--brand-light-blue);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: white;
  transition: var(--transition-smooth);
}

.scale-option input:checked + .scale-circle {
  background-color: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
  transform: scale(1.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scale-option:hover .scale-circle {
  border-color: var(--brand-purple);
}

.scale-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  font-weight: 600;
  min-height: 1.5em;
}

/* Contact Info Section */
.contact-info {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--brand-light-blue);
  text-align: left;
}

.contact-header {
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.contact-info address {
  font-style: normal;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.contact-info p {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.contact-info a {
  color: var(--brand-purple);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.contact-info a:hover {
  color: var(--brand-blue);
  text-decoration: underline;
}

/* Specific fix for long message label to prevent overlap */
.form-group:has(#message:focus) .form-label,
.form-group:has(#message:not(:placeholder-shown)) .form-label {
  width: 100%;
  position: static;
  transform: none;
  margin-bottom: 6px;
  display: block;
  background: transparent;
  pointer-events: none;
  color: var(--brand-blue);
  font-weight: 700;
  font-size: 0.9rem;
}

.form-group:has(#message:focus),
.form-group:has(#message:not(:placeholder-shown)) {
  display: flex;
  flex-direction: column-reverse;
}

/* Ensure the textarea doesn't jump */
#message {
  margin-top: 0;
}
