:root {
  font-size: 15px;
  --green: #075e24;
  --blue: #1976d2;
  --ink: #323437;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  
  /* Sticky Footer layout */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--blue);
}

button, input {
  font: inherit;
}

button, a, input {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid #72b7f1;
  outline-offset: 3px;
}

/* Header Masthead */
.masthead {
  height: 100px;
  background: var(--green);
  color: white;
}

.brand-row {
  max-width: 1030px;
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  text-decoration: none;
  font: bold 15px/21px Georgia, serif;
}

.brand img {
  width: 56px;
  height: 57px;
  object-fit: contain;
}

.brand-right {
  text-align: right;
}

/* Utility & Controls Bar */
.top-area {
  background: #f7f7f7;
  position: sticky;
  top: 0;
  z-index: 10;
}

.utility {
  max-width: 1030px;
  margin: auto;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-title {
  font-size: 22.5px;
  font-weight: 700;
}

.settings {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding-right: 16px;
}

.settings a {
  text-decoration: none;
  margin-right: 32px;
}

.settings button {
  color: var(--blue);
  border: 0;
  background: transparent;
  padding: 5px 8px;
}

.settings .selected {
  background: var(--blue);
  color: white;
}

.font-controls {
  display: flex;
  align-items: center;
  margin-left: 16px;
}

.font-controls button {
  font-size: 22.5px;
  font-weight: bold;
  padding: 0 6px;
}

.font-controls button:last-child {
  font-size: 18.75px;
}

/* Navigation Bar */
.navigation {
  max-width: 1136px;
  margin: auto;
  display: flex;
  min-height: 97.5px;
  align-items: stretch;
}

.home {
  width: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home img {
  width: 32px;
  height: 32px;
}

.nav-items {
  display: flex;
  flex: 1;
}

.nav-link {
  border: 0;
  text-decoration: none;
  background: transparent;
  color: var(--blue);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: bold;
  line-height: 22.5px;
  padding: 16px 10px;
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.nav-link.apply {
  background: #e3f2eb;
  color: #36a467;
  flex: 1.15;
}

.nav-link.emergency {
  background: #ff9500;
  color: #000;
  flex: 1.85;
}

.menu-toggle {
  display: none;
}

/* Main Form Area */
main {
  max-width: 960px;
  margin: auto;
  padding: 44.5px 16px 40px;
  width: 100%;
  
  flex: 1; 
}

h1 {
  font-size: 2rem;
  line-height: 75px;
  margin: 0;
  font-weight: 700;
}

.login-form {
  width: 300px;
  max-width: 100%;
}

.field {
  margin: 0 0 32px;
}

.field label {
  display: block;
  margin-bottom: 4px;
}

.field input {
  display: block;
  width: 296px;
  max-width: 100%;
  height: 40px;
  border: 2px solid #ccc;
  border-radius: 3px;
  padding: 7px 12px;
  color: #333;
  background: #fff;
}

.field input:focus {
  outline: 0;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px #90caf9;
}

.password-field {
  margin-bottom: 32px;
}

.forgot {
  display: inline-block;
  margin-bottom: 32px;
}

/* Captcha Styling */
.captcha {
  width: 302px;
  max-width: 100%;
  height: 76px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fafafa;
  box-shadow: 0 1px 2px #0000000a;
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 15px;
  gap: 14px;
  margin-bottom: 32px;
  color: #444;
}

.captcha input {
  appearance: none;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid #777;
  border-radius: 4px;
  background: #fafafa;
  margin: 0;
  cursor: pointer;
}

.captcha input:checked {
  appearance: auto;
  accent-color: #189f57;
}

.captcha-label {
  font-size: 14px;
  white-space: nowrap;
}

.captcha-brand {
  margin-left: auto;
  text-align: center;
  width: 52px;
  font-size: 10px;
  line-height: 12px;
}

.captcha-mark {
  display: block;
  margin: 0 auto 2px;
  width: 32px;
  height: 32px;
  background: repeating-linear-gradient(135deg, #24b9c1 0 3px, #58cbd0 3px 5px);
  border: 3px solid #a7e8e8;
  color: white;
  font-size: 23px;
  line-height: 25px;
  font-weight: bold;
  border-radius: 8px;
}

.captcha-brand small {
  font-size: 8px;
  white-space: nowrap;
}

.sign-in {
  border: 0;
  border-radius: 3px;
  background: #189f57;
  color: white;
  font-weight: 700;
  padding: 7.5px 15px;
  min-height: 37.5px;
}

.sign-in:hover {
  background: #138349;
}

.notice {
  font-size: 13px;
  margin: 15px 0 0;
  width: 400px;
  max-width: 100%;
  color: #555;
}

.notice:empty {
  display: none;
}

/* Footer Section */
footer {
  background: var(--green);
  color: #fff;
  text-align: center;
  padding: 20px 16px;
  font-size: 13px;
  margin-top: auto;
}

footer a {
  color: #fff;
  display: block;
  line-height: 26px;
}

footer p {
  margin: 10px 0 0;
}

.demo-note {
  color: #d6e8db;
  font-size: 11px;
  margin-top: 5px;
}

/* Dialog Box */
dialog {
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 420px;
  padding: 24px;
  color: var(--ink);
}

dialog::backdrop {
  background: #0005;
}

dialog h2 {
  margin-top: 0;
}

dialog button {
  border: 0;
  background: var(--green);
  color: white;
  padding: 8px 18px;
  border-radius: 3px;
}

/* Media Queries */
@media (min-width: 1400px) {
  .brand-row, .utility {
    max-width: 1140px;
  }
  .navigation {
    max-width: 1240px;
  }
}

@media (max-width: 1100px) {
  .brand-row, .utility {
    margin-left: 32px;
    margin-right: 32px;
  }
  .portal-title {
    font-size: 20px;
  }
  .navigation {
    padding: 0 20px;
  }
  .nav-link {
    font-size: 13px;
    padding-left: 8px;
    padding-right: 8px;
  }
  main {
    margin: 0 7%;
  }
  .settings a {
    margin-right: 15px;
  }
}

@media (max-width: 767px) {
  .masthead {
    height: 92px;
  }
  .brand-row {
    margin: 0 16px;
    gap: 20px;
  }
  .brand {
    font-size: 10px;
    line-height: 15px;
    gap: 8px;
  }
  .brand img {
    width: 42px;
    height: 44px;
  }
  .brand-right {
    gap: 8px;
  }
  .utility {
    margin: 0 16px;
    padding: 12px 0;
    display: block;
  }
  .portal-title {
    font-size: 18px;
  }
  .settings {
    margin-top: 10px;
  }
  .settings a {
    margin-right: auto;
  }
  .settings button {
    font-size: 14px;
  }
  .font-controls {
    margin-left: 10px;
  }
  .navigation {
    padding: 0 16px;
    min-height: 48px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .home {
    width: 32px;
    height: 45px;
  }
  .home img {
    width: 26px;
    height: 26px;
  }
  .menu-toggle {
    display: block;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: transparent;
    margin: 5px 0;
    padding: 3px 12px;
    font-size: 20px;
  }
  .nav-items {
    display: none;
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .nav-items.open {
    display: flex;
  }
  .nav-link {
    flex: 1 1 50% !important;
    min-height: 60px;
    font-size: 13px;
  }
  .top-area {
    position: relative;
  }
  main {
    margin: 0;
    padding: 24px 24px 40px;
    min-height: 530px;
  }
  h1 {
    font-size: 25px;
    line-height: 1.35;
    margin: 0 0 25px;
  }
  .login-form {
    width: 100%;
  }
  .field input {
    width: 100%;
  }
  .captcha {
    width: 302px;
  }
  .brand-right span {
    max-width: 110px;
  }
  footer {
    padding: 16px;
  }
  .demo-note {
    font-size: 11px;
  }
}


/* Custom Alert Box for Fee Notice */
.info-alert {
  margin-top: 15px;
  background-color: #e8f4fd;
  border: 1px solid #b6d4fe;
  border-left: 4px solid #1976d2;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #0c5460;
  line-height: 1.4;
}

.info-alert .alert-icon {
  font-weight: bold;
  color: #1976d2;
  font-size: 15px;
}

.info-alert p {
  margin: 0;
}

/* Payment Modal & Iframe Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-container {
  background: #fff;
  width: 90%;
  max-width: 500px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: #075e24;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 15px;
}

.modal-header button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  height: 600px;
  width: 100%;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Summary & Gateway Modal Extras */
.p-16 {
  padding: 16px;
}

.summary-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.summary-box p {
  margin: 4px 0;
  font-size: 14px;
}

.modal-body h4 {
  margin: 12px 0 8px;
  font-size: 14px;
}

.gateway-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.gateway-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f6f8;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-weight: bold;
}

.gateway-item input[type="radio"] {
  accent-color: #075e24;
  width: 18px;
  height: 18px;
}

.pay-btn {
  width: 100%;
  border: 0;
  background: #075e24;
  color: white;
  font-size: 15px;
  font-weight: bold;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
}

.pay-btn:hover {
  background: #05481b;
}

.error-msg {
  color: red;
  font-size: 13px;
  margin-top: 10px;
}
