/* ===== Basic Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", Arial, sans-serif;
}

body {
  background-color: #f7f9fb;
  background-image: url("../images/pattern.png");
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-attachment: fixed;
  color: #222;
  min-height: 100vh;
}

/* ===== Top Logo Bar ===== */
.logo-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 30px;
  background: transparent;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo-img {
  height: 55px;
  width: auto;
  display: block;
}

.divider {
  width: 2px;
  height: 45px;
  background: #222;
}

.logo-bar h2 {
  font-size: 20px;
  color: #0b1c4d;
}

/* ===== Navy Banner ===== */
.main-header {
  background-color: #0b1c4d;
  color: white;
  text-align: center;
  padding: 20px 20px;
}

.main-header h1 {
  font-size: 22px;
  font-weight: 600;
}

.main-header p {
  font-size: 13px;
  margin-top: 6px;
}

/* ===== Main Content (container holding both cards) ===== */
.container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 28px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #e6eaf0;
}

.form-card {
  width: 42%;
  padding: 20px 24px;
}

.details-card {
  width: 56%;
  overflow: hidden;
}

/* ===== Form (Left Card) ===== */
.input-group {
  margin-bottom: 14px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.star {
  color: #e02020;
}

.input-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: #f1f3f8;
  font-size: 13px;
  outline: none;
}

.input-group input:focus {
  border-color: #0b1c4d;
  background-color: white;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 40px;
}

/* Only the border turns red when a field is empty; background stays the same as before */
.input-wrap input.input-error {
  border-color: #cc0000;
}

.clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: #222;
  cursor: pointer;
}

/* "Mandatory" message aligned to the right */
.mandatory-msg {
  display: none;
  text-align: right;
  color: #cc0000;
  font-size: 11px;
  margin-top: 5px;
}

.mandatory-msg.show {
  display: block;
}

/* ! icon inside a small red circle */
.mandatory-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border: 1px solid #cc0000;
  border-radius: 50%;
  font-size: 9px;
  margin-right: 2px;
}

#check-btn {
  background-color: #0b1c4d;
  color: white;
  border: none;
  padding: 10px 35px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin: 33px auto 0;
  box-shadow: 0 3px 8px rgba(11, 28, 77, 0.3);
  transition: background 0.3s;
}

#check-btn:hover {
  background-color: #0b1c4d;
}

/* ===== Result (Right Card) ===== */
.card-header {
  background-color: #0b1c4d;
  color: white;
  padding: 14px 20px;
}

.card-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.card-body {
  padding: 16px 20px;
}

/* Shown when no matching record is found */
.error-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #fdecea;
  color: #b00020;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;

  /* For the smooth show/hide animation */
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 16px;
  margin-bottom: 0;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease,
    padding 0.4s ease,
    margin 0.4s ease,
    border-color 0.4s ease;
}

.error-box.show {
  max-height: 200px;
  opacity: 1;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-color: #f5c2c7;
}

/* Warning icon (!) inside a red circle */
.warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-color: #b00020;
  color: white;
  border-radius: 50%;
  font-size: 12px;
}

/* Result table, shown when a matching record is found */
.result-content {
  max-height: 600px;
  opacity: 1;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
}

.result-content.hide {
  max-height: 0;
  opacity: 0;
}

.row {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}

.info-box {
  border: 1px solid #cfd6e4;
  padding: 10px 16px;
  border-radius: 14px;
  width: 50%;
}

.info-box .label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 2px;
}

.info-box .value {
  font-size: 15px;
  font-weight: 600;
}

/* Green highlight when a match is found (STATUS and DATE boxes) */
.info-box.valid-box {
  background-color: #eafaf0;
  border-color: rgb(22, 101, 52);
}

/* Date box text also turns green */
#date-box.valid-box .value {
  color: rgb(22, 101, 52);
}

/* Checkmark (✓) inside a round green circle */
.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background-color: rgb(22, 101, 52);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  margin-right: 6px;
}

.details-list p {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eef0f4;
  font-size: 13px;
  font-weight: 500;
}

.details-list p:last-child {
  border-bottom: none;
}

.details-list .key {
  color: #5a6b8c;
  font-weight: 400;
}

/* Bold, navy-blue values in the list below when a match is found */
.details-list .value-highlight {
  font-weight: 700;
  color: #0b1c4d;
}

/* ===== Status Colors ===== */
.status-valid {
  color: rgb(22, 101, 52);
}
.status-pending {
  color: #e69500;
}
.status-rejected {
  color: #cc0000;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 800px) {
  /* Page height equals the screen height; outer page scroll disabled */
  body {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Top section (logo bar + banner) stays fixed */
  .top-fixed {
    flex-shrink: 0;
  }

  .logo-bar {
    padding: 10px 15px;
  }

  .logo-img {
    height: 45px;
  }

  .logo-bar h2 {
    font-size: 16px;
  }

  /* Only this section (the cards) will scroll */
  .container {
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 20px;
    margin: 0;
    padding: 20px 15px;
  }

  .form-card,
  .details-card {
    width: 100%;
    flex-shrink: 0;
  }

  /* STATUS and DATE boxes stacked vertically */
  .row {
    flex-direction: column;
    gap: 10px;
  }

  .info-box {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .info-box .label {
    margin-bottom: 0;
  }
  /* Key stays on the left, value stays on the right (same as desktop) */
  .details-list p {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .details-list p span:last-child {
    text-align: right;
  }

  /* Keep the value in one line and match its font size to the details-list values */
  .info-box .value {
    font-size: 13px;
    white-space: nowrap;
  }

  .info-box .label {
    flex-shrink: 0;
  }
}
