/* Reset and Base Styles */
:root {
  --color-primary: #4b6bab;
  --color-primary-dark: #3c5a97;
  --color-secondary: #64748b;
  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-error: #ef4444;
  --color-success: #22c55e;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base Elements */
body {
  font-family: var(--font-sans);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md);
}

/* Navigation */
.nav {
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.25rem;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

.button-primary {
  background-color: var(--color-primary);
  color: white;
}

.button-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button-secondary {
  background-color: var(--color-secondary);
  color: white;
}

.button-secondary:hover {
  background-color: #475569;
  transform: translateY(-1px);
}

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

/* make sure standard <a> and <button> elements also get fast taps */

a,
button {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}


/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(75, 107, 171, 0.1);
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-3 {
  margin-top: var(--space-md);
}

.mb-3 {
  margin-bottom: var(--space-md);
}

.w-100 {
  width: 100%;
}

/* Footer */
.footer {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-light);
}

.footer-link {
  color: var(--color-text-light);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
  }

  .nav-toggle {
    display: block;
  }
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .container {
    padding: var(--space-lg);
  }

  h1 {
    font-size: 2.25rem;
  }
}

/* Form Container */
.form-container {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--space-lg);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Error Message */
.error-message {
  padding: var(--space-sm) var(--space-md);
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  color: var(--color-error);
}

.error-message p {
  margin: 0;
  font-size: 0.875rem;
}

/* Form Checkbox */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

/* Text Link */
.text-link {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Content Section */
.content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.subtitle {
  font-size: 1.25rem;
  color: var(--color-text-light);
}

/* Grid Layout */
.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-item-large {
    grid-column: span 2;
  }

  .grid-item-full {
    grid-column: 1 / -1;
  }
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-content {
  padding: var(--space-lg);
}

.card-warning {
  border: 1px solid #fbbf24;
}

.card-light {
  background: #f8fafc;
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.text-warning {
  color: #d97706;
}

/* Feature List */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.feature-list li:last-child {
  margin-bottom: 0;
}

/* Text Utilities */
.text-muted {
  color: var(--color-text-light);
}

.small {
  font-size: 0.875rem;
}

/* 1) Make each form-group a relative container and give it bottom padding */
.form-group {
  position: relative;
  padding-bottom: 1.5rem;
  /* enough room for the error line */
}

/* 2) Take the feedback out of flow, under the input */
.form-group .invalid-feedback {
  position: absolute;
  left: 0;
  bottom: 0;
  /* 0 = sits at the bottom of the .form-group */
  width: 100%;
  margin: 0;
  /* remove default margins */
  font-size: 0.875rem;
  color: var(--color-error);
  visibility: hidden;
  /* hide text but keep its box reserved */
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* 3) Only show when .is-invalid is present */
.form-input.is-invalid+.invalid-feedback,
.form-input.is-invalid~.invalid-feedback {
  visibility: visible;
  opacity: 1;
}

/* 4) Remove Bootstrap's validation icons and padding shift */
.form-input.is-valid,
.form-input.is-invalid {
  background-image: none !important;
  padding-right: 0.625rem !important;
}

/* date/time inputs: match .form-input styling + centered */
input[type="date"],
input[type="time"] {
  /* remove native styling */
  -webkit-appearance: none;
  appearance: none;

  /* reuse your form-input rules */
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s ease;

  /* center text (date/time) */
  text-align: center;
  /* make them block so margin auto works */
  display: block;
  margin: 0 auto var(--space-md);
}

/* on focus, same highlight as other inputs */
input[type="date"]:focus,
input[type="time"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(75, 107, 171, 0.1);
}

/* center the entire form-group for date & time */
.form-group.date-time {
  text-align: center;
}