/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* Body */
body {
  background: #f5f6fa;
  color: #333;
  line-height: 1.6;
}

/* Header */
header {
  background: #111827;
  color: #fff;
  padding: 0px 20px;
  text-align: center;
}

header h1 {
  margin-bottom: 10px;
}

nav a {
  color: #fff;
  text-decoration: none;
  margin: 0 10px;
  font-weight: bold;
}

nav a:hover,
nav a.active {
  text-decoration: underline;
}

/* Main Form Section */
.form-container {
  max-width: max-content;
  margin: 40px auto;
  background: #fff;
  padding: 20px 25px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Desktop-only: allow Customer Registration form to be content-sized and centered.
   Scoped to .registration-wrapper so other pages using .form-container are unchanged. */
@media (min-width: 1024px) {
  .registration-wrapper .form-container {
    max-width: max-content;
    margin-left: auto;
    margin-right: auto;
  }
}

.form-container h2 {
  text-align: center;
  color: #0077cc;
}

/* Form Groups */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #444;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  border-color: #0077cc;
}

/* Button */
button {
  width: auto;
  padding: 12px;
  background: #0077cc;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(139, 92, 246, 0.12));
}

/* Footer */
footer {
  /* Keep base footer styling layout-safe; components control visuals. */
  --footer-padding-y: 0;
  --footer-padding-x: 0;
  padding: var(--footer-padding-y) var(--footer-padding-x);
  margin-top: 0;
  text-align: inherit;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

/* Base styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --error-color: #e74c3c;
    --text-color: #2c3e50;
    --background-color: #f8f9fa;
}

/* Header/Footer sizing for fixed header/footer layouts */
:root {
  --header-h: 110px; /* adjust if your header is taller */
  --footer-h: 80px; /* adjust for footer height */
}

/* Ensure body content isn't covered by fixed header/footer */
body {
  padding-top: var(--header-h);
  padding-bottom: var(--footer-h);
}

/* Header & Footer positioning and layering */
header, #site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1100; /* keep above most content */
  display: inline-table;
  background: inherit; /* preserve header background from components */
}

/* If you prefer a fixed header on some pages, add .fixed-header to body */
body.fixed-header header, body.fixed-header #site-header {
  position: fixed;
}

/* Footer default is in-flow; provide a utility to make it fixed */
#site-footer {
  position: relative;
  z-index: 1000;
  height: auto;
}

/* Use this class to make footer fixed to the bottom and avoid overlap */
body.fixed-footer #site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
}

/* Ensure main content area doesn't sit behind fixed header/footer
   If you use a main wrapper, add margin/padding via --header-h/--footer-h */
.main-content {
  padding-top: calc(var(--header-h));
  padding-bottom: calc(var(--footer-h));
}

/* Responsive container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Responsive grid system */
.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(12, 1fr);
}

/* Responsive navigation */
.main-nav {
    background: var(--primary-color);
    padding: 1rem;
}

.nav-toggle {
    display: none;
}

/* Mobile first breakpoints */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
    }

    .nav-menu.active {
        display: block;
    }

    .grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Stack form elements */
    .form-group {
        grid-column: span 4;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .form-group {
        grid-column: span 4;
    }
}

/* Error handling styles */
#error-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
}

.alert-error {
    background: var(--error-color);
    color: white;
}

.alert .close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}
