* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg, #8ea8c3 0%, #eef2f6 55%);
  min-height: 100vh;
  color: #1f2a37;
}

/* Form controls don't inherit the body font by default in most browsers. */
input, select, button, textarea, option {
  font-family: inherit;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.header h1 {
  margin: 0 0 6px;
  color: #7a1f1f;
  font-size: 28px;
}

.subtitle {
  margin: 0;
  color: #4b5563;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-width: 100%;
}

.search-form input {
  flex: 1;
  min-width: 140px;
  max-width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
  text-align: center;
}

.search-form select {
  flex: 1;
  min-width: 140px;
  max-width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  background: #fff;
  color: #1f2a37;
}

.search-form button {
  background: #a3231f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.search-form button:hover { background: #8a1c19; }
.search-form button:disabled { opacity: 0.6; cursor: default; }

.developer-credit {
  margin: 10px 0 0;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

.message {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff3cd;
  color: #7a5b00;
  text-align: center;
}

.message.error { background: #fde2e1; color: #7a1f1f; }

.results-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.result-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.result-item:hover { border-color: #a3231f; }

.result-item .plate {
  font-weight: 700;
  font-size: 18px;
}

.result-item .meta {
  color: #6b7280;
  font-size: 14px;
}

.details-card {
  margin-top: 20px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  overflow: hidden;
}

.details-card .card-header {
  background: #a3231f;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.details-card .card-header .plate-num {
  font-size: 24px;
  font-weight: 800;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: #e5e7eb;
}

.info-grid .field {
  background: #fff;
  padding: 14px 18px;
}

.info-grid .field .label {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 4px;
}

.info-grid .field .value {
  font-size: 16px;
  font-weight: 600;
}

.dues-section {
  padding: 18px 20px;
  border-top: 3px solid #a3231f;
  background: #fff7f6;
}

.dues-section h3 {
  margin: 0 0 12px;
  color: #7a1f1f;
}

.dues-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.due-item {
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
  border: 1px solid #f0d9d8;
}

.due-item .label { font-size: 13px; color: #6b7280; }
.due-item .value { font-size: 18px; font-weight: 700; color: #7a1f1f; }

.total-due {
  margin-top: 12px;
  text-align: center;
  background: #a3231f;
  color: #fff;
  border-radius: 8px;
  padding: 14px;
  font-size: 20px;
  font-weight: 800;
}

.card-actions {
  padding: 14px 20px 0;
  text-align: center;
}

.save-btn {
  background: #0f7b3f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.save-btn:hover { background: #0c6633; }
.save-btn:disabled { opacity: 0.6; cursor: default; }

.back-link {
  display: inline-block;
  margin: 14px 20px 20px;
  color: #a3231f;
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .page {
    padding: 20px 14px 40px;
  }

  .header h1 {
    font-size: 22px;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form input,
  .search-form select,
  .search-form button {
    width: 100%;
    min-width: 0;
  }

  .info-grid,
  .dues-grid {
    grid-template-columns: 1fr;
  }

  .details-card .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
