/* Reset some default styles */
* {
  box-sizing: border-box;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

header {
  background-color: #007bff;
  color: #fff;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 0 0 10px 10px;
}
header h1 {
  font-weight: 700;
  font-size: 1.8rem;
  margin: 0;
  letter-spacing: 1px;
}
header nav a {
  color: #e1e9f8;
  text-decoration: none;
  font-weight: 600;
  margin-left: 24px;
  transition: color 0.3s ease;
  font-size: 1rem;
}
header nav a:hover {
  color: #ffdd57;
}

main {
  max-width: 900px;
  background-color: #fff;
  margin: 40px auto;
  padding: 30px 40px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

h2 {
  color: #222222; /* Dark enough for light background */
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 20px;
  border-bottom: 3px solid #007bff;
  padding-bottom: 8px;
}

/* Dark mode */
body.dark-mode h2 {
  color: #e1e1e1; /* Light enough for dark background */
  border-bottom-color: #90caf9; /* A lighter blue for contrast */
}

p, li {
  font-size: 1.1rem;
  color: #555;
}

/* Flash messages */
.flash {
  padding: 14px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
}
.flash.success {
  background-color: #e6f7e6;
  color: #207520;
  border: 1px solid #a4d4a4;
}
.flash.danger {
  background-color: #fdecea;
  color: #a11c1c;
  border: 1px solid #f5b3b3;
}
.form-error {
  color: #e74c3c;
  font-size: 0.98em;
  padding-left: 4px;
  display: block;
  margin-top: 2px;
  font-weight: 500;
}


/* Forms styling */
form p {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: #444;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="tel"] {
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.25s ease;
}
form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="email"]:focus,
form input[type="tel"]:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
}

form input::placeholder {
  color: #aaa;
  font-weight: 400;
}

/* Submit button */
form p:last-child {
  margin-top: 24px;
}

form button,
form input[type="submit"] {
  background-color: #007bff;
  border: none;
  color: white;
  padding: 14px 28px;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.3s ease;
}
form button:hover,
form input[type="submit"]:hover {
  background-color: #0056b3;
}

/* Dashboard link button */
button:disabled {
  background-color: #a0a0a0 !important;
  cursor: not-allowed;
  opacity: 0.7 !important;
  transition: none !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  header nav {
    margin-top: 12px;
  }
  header nav a {
    margin-left: 0;
    margin-right: 20px;
  }
  main {
    margin: 20px;
    padding: 20px;
  }
}
/* Dark mode styles */
body.dark-mode {
  background-color: #121212;
  color: #e1e1e1;
}

body.dark-mode header {
  background-color: #1f1f1f;
  color: #e1e1e1;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

body.dark-mode header nav a {
  color: #bbb;
}
body.dark-mode header nav a:hover {
  color: #ffd55a;
}

body.dark-mode main {
  background-color: #222;
  color: #ddd;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* Flash messages */
body.dark-mode .flash.success {
  background-color: #2a4d2a;
  color: #a3d9a5;
  border: 1px solid #4caf50;
}
body.dark-mode .flash.danger {
  background-color: #4d1a1a;
  color: #f88;
  border: 1px solid #f44336;
}

/* Form fields */
body.dark-mode form input[type="text"],
body.dark-mode form input[type="password"],
body.dark-mode form input[type="email"],
body.dark-mode form input[type="tel"] {
  background-color: #333;
  border: 2px solid #555;
  color: #eee;
}

body.dark-mode form input[type="text"]:register:placeholder,
body.dark-mode form input[type="password"]::placeholder,
body.dark-mode form input[type="email"]::placeholder,
body.dark-mode form input[type="tel"]::placeholder {
  color: #aaa;
}

body.dark-mode form input[type="text"]:focus,
body.dark-mode form input[type="password"]:focus,
body.dark-mode form input[type="email"]:focus,
body.dark-mode form input[type="tel"]:focus {
  border-color: #90caf9;
  box-shadow: 0 0 8px rgba(144, 202, 249, 0.8);
  background-color: #444;
  color: #fff;
}

/* Buttons */
body.dark-mode form button,
body.dark-mode form input[type="submit"],
body.dark-mode button {
  background-color: #90caf9;
  color: #222;
}

body.dark-mode form button:hover,
body.dark-mode form input[type="submit"]:hover,
body.dark-mode button:hover {
  background-color: #64b5f6;
  color: #121212;
}

/* Disabled buttons */
body.dark-mode button:disabled {
  background-color: #555 !important;
  opacity: 0.6 !important;
}

footer {
  width: 100%;
  background-color: #f5f7fa;
  color: #555;
  text-align: center;         /* Horizontal center */
  padding: 18px 0 8px 0;
  margin-top: 40px;
  font-size: 1rem;
  border-top: 1px solid #e4e4e4;
  border-radius: 0 0 10px 10px;

  /* To vertically center content if footer height grows */
  display: flex;
  justify-content: center;    /* horizontal centering */
  align-items: center;        /* vertical centering */
  min-height: 50px;           /* Optional: set a min height for consistent vertical centering */
}

body.dark-mode footer {
  background-color: #1b1b1b;
  color: #aaa;
  border-top-color: #222;
}

