/* ======================= */
/* Base */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background: #f9fafb;
  color: #111827;
}
.container {
  width: 90%;
  max-width: 1000px;
  margin: auto;
  padding: 2rem 0;
}
h1, h2, h3 {
  margin-bottom: 1rem;
}
section {
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  margin: 0.3rem;

  display: inline-block;
  text-decoration: none;   /* remove underline */
  color: inherit;          /* use button color, not default link blue */
  text-align: center;
  line-height: 1.4;
  transition: background 0.2s ease, color 0.2s ease; /* smooth hover */
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-outline { border: 1px solid #2563eb; background: none; color: #2563eb; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }

/* Button Hover States */
.btn-primary:hover { background: #1e4ed8; }   /* slightly darker blue */
.btn-secondary:hover { background: #4b5563; } /* darker gray */
.btn-outline:hover { background: #2563eb; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success:hover { background: #15803d; }


/* Forms */
.form input, .form select, .form textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 0.6rem 0.8rem; /* 🔹 equal, slightly larger left/right padding */
  box-sizing: border-box;   /* <--- critical fix */
  margin: 0;                 /* spacing handled by .form-group */
  font-size: 0.95rem;
}

.form button {
  margin-top: 0.5rem;  /* tighter spacing */
}

/* Even tighter if immediately after a form-group */
.form-group + button {
  margin-top: 0.25rem;
}

/* ======================= */
/* Form Validation Styling */
.form-group {
    position: relative;
    margin-bottom: 0.9rem; /* 🔹 slightly tighter spacing between fields */
}

.form-group.invalid input,
.form-group.invalid select,
.form-group.invalid textarea {
  border-color: #dc2626; /* red border for errors */
  background-color: #fff5f5;
}

.form-group.valid input,
.form-group.valid select,
.form-group.valid textarea {
  border-color: #16a34a; /* green border for success */
  background-color: #f6fff9;
}

/* === Form group & error messages (UI kit) === */
.form-group .error-message {
    font-size: 0.75rem;
    color: var(--danger, #dc2626);
    margin-top: 0.25rem;
    position: static;         /* absolute positioning */
    left: 0;
    bottom: -0.25rem;           /* very close to the input's bottom */
    width: 100%;
     line-height: 1.2;
    display: none;               /* hidden initially */
}

.form-group .error-message-server {
    font-size: 0.75rem;
    color: var(--danger, #dc2626);
    margin-top: 0.25rem;
    position: static;         /* absolute positioning */
    left: 0;
    bottom: -0.25rem;           /* very close to the input's bottom */
    width: 100%;
     line-height: 1.2;
    /* display: none;               hidden initially */
}

.form-group.invalid .error-message {
    display: block;              /* show on validation error */
}

/* .form-group .error-message { */
  /* font-size: 0.8rem; */
  /* color: #dc2626; */
  /* margin-top: 0.25rem; */
  /* display: none; */
/* } */

.alert-success {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  border: 1px solid #16a34a;
  background-color: #f6fff9;
  color: #16a34a;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}
.alert-success.show {
  display: block;
}

.alert-danger {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  border: 1px solid #dc2626;
  background-color: #fff5f5;
  color: #dc2626;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}
.alert-danger.show {
  display: block;
}

/* Cards */
.card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  margin: 1rem 0;
}

/* Alerts (general alerts, can override with .alert-success/.alert-danger above) */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  font-weight: 500;
}
.alert-info { background: #e0f2fe; color: #0369a1; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #b91c1c; }
.alert-warning { background: #fef9c3; color: #92400e; }

/* Badges */
.badge {
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-primary { background: #2563eb; color: #fff; }
.badge-success { background: #16a34a; color: #fff; }
.badge-warning { background: #facc15; color: #111; }
.badge-danger { background: #dc2626; color: #fff; }

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.table th, .table td {
  padding: 0.8rem;
  border: 1px solid #e5e7eb;
  text-align: left;
}
.table th {
  background: #f3f4f6;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tab-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  background: #e5e7eb;
}
.tab-btn.active { background: #2563eb; color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 400px;
  position: relative;
}
.modal .close {
  position: absolute;
  top: 10px; right: 15px;
  cursor: pointer;
  font-size: 1.2rem;
}

