body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background-color: #f4f7f9; /* Light, professional gray-blue */
  margin: 0;
  color: #333;
}

/* Updated Header for OAGChildSupport.com */
header {
  background-color: #002e5d; /* OAG Navy */
  padding: 25px 0;
  width: 100%;
  border-bottom: 5px solid #d9534f; /* OAG Red accent line */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  width: 100%;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 25px;
}

.brand-cardinal {
  height: 100px; /* Enlarged for visibility */
  width: auto;
  margin-right: 25px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.portal-title {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.5px;
}

#auth-container {
  background: white;
  max-width: 350px;
  margin: 80px auto;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

#auth-container input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box; /* This fixes the side-by-side issue */
}

/* ADD THIS: Styles the Sign In button */
#login-btn {
  width: 100%;
  padding: 12px;
  background-color: #002e5d; /* OAG Navy */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
}

#logout-btn {
  background: transparent;
  border: 1px solid white;
  color: white;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

#logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

#resource-list {
  max-width: 1100px;
  margin: 40px auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  padding: 0 20px;
}

/* The "Brilliant White" Cards */
.resource-card {
  background-color: #ffffff;
  padding: 24px;
  border-radius: 8px;
  border-top: 5px solid #002e5d; /* OAG Navy anchor */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.description {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.toolkit-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Standard Button Style */
.action-btn {
  background-color: #002e5d;
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: left;
  width: 100%;
}

.action-btn:hover {
  filter: brightness(1.2);
  cursor: pointer;
}

/* Highlights the specific button containing the deep search match */
.action-btn.btn-deep-match {
  background-color: #d9534f !important; /* OAG Red */
  color: white !important;
  border: 1px solid #ffffff;
  box-shadow: 0 0 10px rgba(217, 83, 79, 0.5);
}

.pleading-style {
  background-color: #28a745 !important; /* Green for action/copying */
}

/* --- MODAL LOGIC --- */

/* Generic Modal Class - This keeps BOTH memos and password prompt hidden */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Dims background */
  overflow-y: auto;
  padding: 20px 0;
}

.modal-content {
  background-color: #fff;
  margin: 2% auto;
  padding: 40px;
  width: 85%;
  max-width: 900px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Password Form Specific Style */
.password-form {
  max-width: 400px;
  text-align: center;
}

/* INSERT THE NEW PASSWORD FORMATTING HERE */

/* Specifically shrinks the modal for the password task */
.password-form {
  max-width: 450px !important; /* Reduces width from the default 85% */
  margin: 5% auto !important; /* Brings the modal higher on the screen */
  padding: 30px !important; /* Slightly more compact internal padding */
}

/* Adjusts the logo to feel less dominant */
.modal-logo {
  height: 80px; /* Reduced from the large header size */
  width: auto;
  margin-bottom: 10px;
}

.password-form h2 {
  font-size: 1.5rem; /* Slightly smaller for a tighter header group */
  margin-bottom: 10px;
}
.password-form input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.password-form .action-btn {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

.password-form .secondary-btn {
  width: 100%;
  margin: 10px 0 0 0;
  background: #f1f1f1;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Container that holds both the input and the icon */
.input-wrapper {
  position: relative;
  display: flex; /* Ensures elements are aware of each other on the same line */
  align-items: center;
  width: 100%;
}

.input-wrapper input {
  width: 100%;
  padding-right: 45px !important; /* Prevents text from overlapping the eye */
  margin: 10px 0;
}

/* Position the eye icon INSIDE the right side of the input */
.toggle-password {
  position: absolute;
  right: 15px; /* Adjusts horizontal distance from the right edge */
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  color: #666;
  z-index: 5;
  /* Centers the icon vertically within the wrapper */
  display: flex;
  align-items: center;
  height: 100%;
}

.toggle-password:hover {
  color: #002e5d; /* OAG Navy */
}

/* ... existing Mobile Optimization code (@media) should follow ... */

.error-text {
  color: #d9534f; /* OAG Red for errors */
  font-size: 0.9rem;
  margin-top: 10px;
}

.secondary-btn {
  background: #f1f1f1;
  border: 1px solid #ddd;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
}

.back-to-home {
  display: block;
  background: #f1f1f1;
  border: 1px solid #002e5d;
  color: #002e5d;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 20px;
  border-radius: 4px;
}

#modal-body {
  line-height: 1.8;
  font-size: 1.25rem;
  color: #222;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 20px;
}

.search-highlight {
  background-color: #ffeb3b; /* Bright legal-pad yellow */
  color: #000;
  padding: 2px 0;
  font-weight: bold;
  border-radius: 2px;
}

/* Controls & Search Bar */
#portal-controls {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
}

#portal-search {
  width: 100%;
  padding: 15px;
  border: 2px solid #002e5d;
  border-radius: 8px;
  font-size: 1.1rem;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.filter-btn {
  background: white;
  border: 2px solid #002e5d;
  color: #002e5d;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
}

.filter-btn.active {
  background: #002e5d;
  color: white;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  .brand-cardinal {
    height: 70px;
    margin-right: 0;
    margin-bottom: 10px;
  }
  .portal-title {
    font-size: 1.4rem;
  }
}
