/*
 * Styles specific to the authentication and admin pages.
 * This file defines a few CSS custom properties (variables) that
 * mirror the palette used on the public pages.  By reusing the
 * colours and fonts your admin area feels cohesive with the rest
 * of the site.  The layout is responsive and works on phones,
 * tablets and desktops.
 */

/* Reset and variables */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /*
   * Colour palette extracted from the provided logo.  Primary is a
   * deep maroon for emphasis and calls to action.  Secondary tones
   * include a soft pink used for highlights.  Cards use pure
   * white to maintain contrast.  Muted tones support labels and
   * placeholder text without overwhelming the user.
   */
  --primary: #852d38;
  --primary-2: #f5c5d9;
  --accent: #91444b;
  --muted: #b68081;
  --card-bg: #ffffff;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(20, 10, 30, 0.12);
}

body {
  font-family: "Open Sans", sans-serif;
  min-height: 100vh;
  /* Apply soft pastel gradients derived from the refreshed palette */
  background: radial-gradient(1200px 700px at 10% 0%, var(--primary-2) 0%, transparent 60%),
              radial-gradient(1000px 600px at 90% 10%, var(--primary-2) 0%, transparent 55%),
              var(--card-bg);
  color: var(--accent);
}

/* Shared button style */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-align: center;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 28px rgba(212, 193, 199, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(212, 193, 199, 0.45);
}
.btn-secondary {
  color: var(--accent);
  /* soften secondary button background using the new soft pastel */
  background: #FDF7F9;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}

/* Authentication pages */
.auth-wrapper {
  width: 100%;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem 2.5rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-title {
  font-family: "Playfair Display", serif;
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.6rem;
}
.auth-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius);
  font-size: 1rem;
}
.form-group textarea {
  resize: vertical;
  min-height: 120px;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.auth-links a {
  color: var(--primary);
  text-decoration: none;
}
.back-home {
  margin-top: 1rem;
}
.back-home a {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.error-message {
  color: #e74c3c;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Admin dashboard */
.admin-nav {
  /* soften nav background to match the page background */
  background: rgba(251, 246, 242, 0.9);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 998;
  /* create a positioning context for the centred logo */
  position: relative;
}
  .admin-nav .logo {
  /* centre the logo horizontally within the admin nav */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0;
  /* remove default typography since only the icon remains */
  font-family: unset;
  font-size: unset;
  font-weight: unset;
  color: inherit;
 }
.admin-nav .nav-links a {
  margin-left: 1.5rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.dashboard-container {
  width: min(90%, 1200px);
  margin: 2rem auto;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.dashboard-header h2 {
  font-family: "Playfair Display", serif;
  color: var(--accent);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table th,
.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  text-align: left;
  vertical-align: top;
}
.table th {
  background: #faf7fa;
  font-weight: 600;
}
.action-btn {
  margin-right: 0.6rem;
  cursor: pointer;
  color: var(--primary);
  text-decoration: underline;
  font-size: 0.9rem;
}
.action-btn.delete {
  color: #e74c3c;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

/* ------------------------------------------------------------------
   Responsive overrides for admin and auth pages
   These rules mirror the global responsive adjustments used across
   the public site. They ensure content does not overflow, images
   scale down, and tables/sections remain usable on mobile devices.
------------------------------------------------------------------ */

html, body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  /* Make tables scrollable on smaller screens */
  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
  /* Allow dashboard header to stack vertically */
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  /* Stack form action buttons and stretch full width */
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .btn {
    width: 100%;
  }
  /* Ensure auth-wrapper has enough padding on small screens */
  .auth-wrapper {
    padding-left: 16px;
    padding-right: 16px;
  }
}