/* =============================================================================
   CAASL UI Revamp — UI-S6 Functional Pages (Direction A "Colombo FIR")
   Forms + search + error styling, CSS-only over Joomla core layouts/extensions.
   Covers: com_users (login/registration/reset/profile), com_contact form,
   mod_login, mod_sp_quickcontact, com_finder search, SP Polls, system alerts,
   and the standalone error.php. Preserves all fields/tokens/actions/validation.
   ============================================================================ */

/* ---------- generic form controls ---------- */
.form-control, input[type=text], input[type=email], input[type=password],
input[type=search], input[type=tel], input[type=url], input[type=number],
input[type=date], textarea, select, .inputbox{
  width:100%; max-width:480px; background:var(--white); color:var(--ink);
  border:1px solid var(--line-strong); border-radius:var(--radius);
  padding:10px 12px; font-family:var(--body); font-size:1rem; line-height:1.4; }
textarea{ min-height:120px; }
.form-control:focus, input:focus, textarea:focus, select:focus{
  border-color:var(--navy); box-shadow:0 0 0 3px rgba(11,42,74,.12); outline:none; }
.form-control::placeholder{ color:#8a99a8; }
label, .control-label{ font-weight:600; color:var(--navy); display:inline-block; margin-bottom:5px; }
.control-group, .controls, .form-group, fieldset{ margin-bottom:16px; }
fieldset{ border:0; padding:0; min-width:0; }
fieldset legend{ font-family:var(--display); font-weight:700; color:var(--navy); font-size:1.15rem;
  border-bottom:1px solid var(--line); padding-bottom:8px; margin-bottom:14px; width:100%; }
.star, .required .star, .form-control-feedback.required{ color:#b3261e; }

/* submit buttons (foundation styles .btn-primary amber; ensure form submits match) */
button[type=submit], input[type=submit], .btn-primary, .login button{
  font-family:var(--display); font-weight:700; cursor:pointer; }

/* ---------- validation / messages ---------- */
.invalid, input.invalid, .form-control.invalid{ border-color:#b3261e !important; }
.parsley-errors-list, .form-control-feedback, .invalid-feedback{
  list-style:none; padding:0; margin:6px 0 0; color:#b3261e; font-size:.85rem; }
.alert{ border-radius:var(--radius); border:1px solid var(--line); padding:12px 16px; margin:0 0 16px; }
.alert-message, .alert-success{ border-left:4px solid var(--teal); background:#f0f8f7; }
.alert-warning, .alert-notice{ border-left:4px solid var(--amber); background:#fff8e8; }
.alert-danger, .alert-error{ border-left:4px solid #b3261e; background:#fdf0ef; }

/* ---------- com_users (login / registration / reset / profile) ---------- */
.com-users-login__form, .com-users-registration, .com-users-profile,
.com-users-remind, .com-users-reset, .mod-login, .login{
  max-width:560px; }
.com-users-login__rules, .com-users-registration .com-users-profile__rules{ color:var(--ink-muted); font-size:.9rem; }
.com-users-login__submit, .login .control-group:last-child{ margin-top:8px; }
.com-users-login__links a, .login a, .mod-login a{ color:var(--teal); }

/* ---------- mod_sp_quickcontact (inline inquiry) ---------- */
.sp-quickcontact .form-control{ max-width:none; }

/* ---------- com_finder search ---------- */
.com-finder, .finder, #search-form{ max-width:none; }
/* The IcoMoon glyphs (.icon-search / .icon-search-plus) were stripped in J6, so they
   rendered as a stray "S" before the button labels (ss/41). Hide them — the text
   labels ("Search", "Advanced Search") are clear on their own. */
.icon-search, .icon-search-plus, .icon-search-minus, .icon-options{ display:none !important; }
/* The form ships Bootstrap-5 markup (.input-group/.form-control) on a Bootstrap-3 site,
   so it renders unstyled and cramped (ss/41/45). Style it as a clean rounded search bar:
   label + pill input-group (input · amber Search · navy Advanced Search). */
.com-finder__search{ margin-top:20px; }
/* the "Search Form" legend renders as a heading with a border-bottom rule (the BS5
   .visually-hidden class isn't styled here); give it room and push the box below it (ss/50). */
.com-finder__search > legend{ font-family:var(--display); font-weight:700; color:var(--navy);
  font-size:1.25rem; width:100%; padding-bottom:12px; margin-bottom:0; border-bottom:1px solid var(--line); }
.com-finder__search .form-inline{ display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin:22px 0 6px; }
.com-finder__search label{ font-family:var(--display); font-weight:700; color:var(--navy); margin:0; white-space:nowrap; }
.com-finder__search .input-group{ display:flex; align-items:stretch; flex:1 1 420px; max-width:680px;
  border:1.5px solid var(--line); border-radius:999px; overflow:hidden; background:var(--white);
  box-shadow:0 1px 3px rgba(11,42,74,.08); transition:border-color .15s, box-shadow .15s; }
.com-finder__search .input-group:focus-within{ border-color:var(--navy); box-shadow:0 0 0 3px rgba(15,110,114,.22); }
/* the input (or any wrapper Bootstrap puts around it) must grow so the buttons sit flush
   at the RIGHT end of the pill — not stranded mid-bar (ss/48). */
.com-finder__search .input-group > *:first-child{ flex:1 1 auto !important; width:auto !important; max-width:none !important; }
.com-finder__search .input-group .form-control{ flex:1 1 auto !important; width:auto !important; max-width:none !important;
  border:0 !important; outline:0 !important;
  background:transparent !important; box-shadow:none !important; min-width:0; padding:11px 20px; font-size:1rem; height:auto; }
.com-finder__search .input-group .btn{ border:0 !important; border-radius:0 !important; padding:11px 22px;
  font-family:var(--display); font-weight:700; white-space:nowrap; cursor:pointer; display:inline-flex; align-items:center; }
.com-finder__search .input-group .btn-primary{ background:var(--amber) !important; color:var(--amber-ink) !important; }
.com-finder__search .input-group .btn-primary:hover{ background:#ffbd1a !important; }
.com-finder__search .input-group .btn-secondary{ background:var(--navy) !important; color:#fff !important; }
.com-finder__search .input-group .btn-secondary:hover{ background:var(--navy-600) !important; }
.com-finder input[type=search], .js-finder-searchquery{ max-width:520px; }
.search-results, .result-list, .com-finder__results{ list-style:none; padding:0; margin:18px 0 0; display:grid; gap:14px; }
.result__title, .result-title{ font-family:var(--display); font-weight:700; font-size:1.1rem; }
.result__title a, .result-title a{ color:var(--navy); text-decoration:none; }
.result__title a:hover{ color:var(--teal); }
.result__url, .result-url, .search-result-url{ font-family:var(--mono); font-size:.76rem; color:var(--teal); word-break:break-all; }
.result__program, .result-text, .search-result-description{ color:var(--ink); }
.result, .search-results > li, .result-item{ background:var(--white); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow); padding:16px 18px; }
.finder-pagination, .search .pagination{ margin-top:20px; }
fieldset.filters, .com-finder__advanced{ background:var(--paper); border:1px solid var(--line);
  border-radius:var(--radius); padding:14px 16px; margin-bottom:16px; }

/* ---------- SP Polls ---------- */
.sppolls, .sppolls-wrap{ background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:16px 18px; }
.sppolls .sppolls-bar, .sppolls-bar-fill{ background:var(--amber); }
.sppolls button, .sppolls .btn{ margin-top:10px; }

/* ---------- standalone error.php (Direction A) ---------- */
body.error{ background:var(--paper); color:var(--ink); font-family:var(--body); }
body.error .body > .container{ max-width:900px; margin:0 auto; padding:0 20px; }
body.error header.header{ background:transparent; border:0; box-shadow:none; padding:24px 0 8px; }
body.error .brand{ display:inline-flex; align-items:center; gap:14px; text-decoration:none; }
body.error .brand img{ height:64px; width:auto; }
body.error h1.page-header{ font-family:var(--display); font-weight:800; color:var(--navy);
  font-size:clamp(1.8rem,4vw,2.6rem); border-bottom:1px solid var(--line); padding-bottom:14px; margin:8px 0 22px; }
body.error .well{ background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:24px 26px; }
body.error .well strong{ color:var(--navy); }
body.error blockquote{ border-left:4px solid var(--amber); background:var(--paper); padding:10px 16px;
  border-radius:0 var(--radius) var(--radius) 0; margin:14px 0 0; }
body.error .badge{ background:var(--navy); color:#fff; border-radius:3px; padding:3px 8px; font-family:var(--mono); }
body.error .btn{ display:inline-flex; align-items:center; gap:8px; background:var(--amber);
  color:var(--amber-ink); border:0; border-radius:var(--radius); padding:10px 18px; font-family:var(--display);
  font-weight:700; text-decoration:none; }
body.error .btn:hover{ background:#ffbd1a; }
body.error .footer{ color:var(--ink-muted); font-size:.85rem; padding:20px 0; }
body.error a{ color:var(--teal); }

/* UI-S7: prevent tiny mobile overflow from the finder 'explained' line */
.com-finder__explained, .search-results, .result__url{ overflow-wrap:anywhere; word-break:break-word; }
