/* ============================================================
   RecruitInMalta — shared public form theme  (rim-forms.css)

   One brand theme for public-facing form pages.
   Use it either way:
     A) Load the shell partials (recommended):
          $this->load->view('common/public_header');  // + $page_title
          ...your page content...
          $this->load->view('common/public_footer');
     B) Or just link this file in any page:
          <link rel="stylesheet" href="<?= base_url('assets/css/rim-forms.css') ?>">

   Re-tune the whole look from the tokens in :root below.
   ============================================================ */

:root {
  /* Brand */
  --blue:        #337ab7;
  --blue-dark:   #285e8e;
  --green:       #109618;
  --green-hover: #0d7c14;

  /* Ink & surfaces */
  --navy:        #0b1e5b;   /* headings */
  --text:        #0b0c2c;   /* body text */
  --muted:       #6b7280;   /* hint / help text */
  --subtle:      #4c5563;
  --bg:          #f5f6f8;
  --white:       #ffffff;
  --hairline:    #eceef1;   /* row dividers */
  --input-border:#c5ccd6;
  --tile-bg:     #eaf1fb;   /* icon tiles */

  /* Feedback */
  --error:       #d5281b;
  --success:     #00703c;
  --focus-ring:  rgba(51, 122, 183, .18);
  --focus:       #ffeb3b;   /* keyboard focus highlight (shared with the PC application form) */

  /* Form controls — matched to the candidate application (PC) form */
  --field-border: #4c6272;  /* strong 2px input border */
  --green-shadow: #0a5c0f;  /* 3D primary-button shadow */
  --btn-2-bg:     #f0f4f5;  /* secondary-button face */
  --btn-2-shadow: #a4b0b7;  /* secondary-button shadow */

  --radius:      8px;
  --radius-card: 12px;
  --maxw:        1000px;

  /* Typography — same families as recruitinmalta.mt */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / brand ---------- */
.site-header { background: var(--blue); padding: 12px 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand__logo { height: 44px; display: block; }
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: #fff; color: var(--blue);
  border-radius: 6px; font-weight: 800; letter-spacing: .5px;
}
.brand__name { font-family: var(--font-head); font-size: 19px; font-weight: 700; line-height: 1; }
.brand__name small { display: block; font-size: 12px; font-weight: 400; opacity: .9; margin-top: 3px; }

/* ---------- Page heading ---------- */
.page-heading { margin: 40px 0 24px; }
.page-heading h1 { margin: 0 0 12px; font-family: var(--font-head); font-size: 40px; font-weight: 700; letter-spacing: -.5px; color: var(--navy); }
.page-heading p { margin: 0; font-size: 17px; color: var(--subtle); max-width: 46em; }
.req { color: var(--error); }

/* ---------- Card + icon-tile field rows ---------- */
.card {
  background: var(--white); border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06);
  overflow: hidden; margin-bottom: 40px;
}
.card-body { padding: 8px 32px; }

.field-row {
  display: flex; align-items: flex-start; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--hairline);
}
.field-row:last-of-type { border-bottom: none; }
.field-label { flex: 0 0 46%; display: flex; align-items: flex-start; gap: 16px; }
.field-icon {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px;
  background: var(--tile-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.field-icon svg { width: 22px; height: 22px; }
.field-label h3 { margin: 4px 0; font-size: 18px; font-weight: 700; color: var(--navy); }
.field-label p { margin: 0; font-size: 15px; color: var(--muted); }
.field-input { flex: 1 1 auto; }

/* ---------- Inputs (inside card and generic) ---------- */
.field-input input[type="text"],
.field-input input[type="email"],
.field-input input[type="url"],
.field-input input[type="tel"],
.field-input input[type="number"],
.field-input textarea,
.field-input select,
.form-control {
  display: block; width: 100%; max-width: 100%;
  padding: 8px 12px; font-size: 17px; font-family: inherit; line-height: 1.5;
  color: var(--text); background: #fff;
  border: 2px solid var(--field-border); border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.field-input textarea, .form-control.textarea { min-height: 120px; resize: vertical; }
.field-input input:focus,
.field-input textarea:focus,
.field-input select:focus,
.form-control:focus {
  outline: 2px solid var(--focus); outline-offset: 0;
  border-color: var(--field-border);
  box-shadow: inset 0 0 0 2px var(--text);
}

/* ---------- Terms row ---------- */
.terms-row {
  padding: 20px 32px; border-top: 1px solid var(--hairline);
}

/* Custom checkbox — matched to the PC application form */
.checkboxes__item { position: relative; }
.checkboxes__input {
  position: absolute; left: 0; top: 0; width: 30px; height: 100%;
  margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.checkboxes__label {
  position: relative; display: inline-block;
  padding: 4px 12px 4px 42px; cursor: pointer; font-size: 17px; line-height: 1.4;
}
.checkboxes__label::before {
  content: ""; position: absolute; left: 0; top: calc(50% + 1px); transform: translateY(-50%);
  width: 28px; height: 28px; border: 2px solid var(--text); background: #fff;
}
.checkboxes__label::after {
  content: ""; position: absolute; left: 7px; top: calc(50% + 1px);
  width: 14px; height: 7px; border: solid var(--text); border-width: 0 0 3px 3px;
  transform: translateY(-75%) rotate(-45deg); opacity: 0;
}
.checkboxes__input:checked + .checkboxes__label::after { opacity: 1; }
.checkboxes__input:focus + .checkboxes__label::before { box-shadow: 0 0 0 4px var(--focus); }

/* ---------- Card actions ---------- */
.card-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  padding: 20px 32px 24px; background: #f8f9fb; border-top: 1px solid var(--hairline);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  font-size: 17px; font-weight: 700; font-family: inherit; line-height: 1;
  border: 2px solid transparent; border-radius: 4px;
  cursor: pointer; text-decoration: none; position: relative;
}
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-shadow); }
.btn-primary:hover { background: var(--green-hover); color: #fff; }
.btn-primary:active { top: 4px; box-shadow: none; }
.btn-secondary { background: var(--btn-2-bg); color: var(--text); box-shadow: 0 4px 0 var(--btn-2-shadow); }
.btn-secondary:hover { background: #dbe1e3; color: var(--text); }
.btn-secondary:active { top: 4px; box-shadow: none; }
.btn:focus { background: var(--focus); color: var(--text); box-shadow: 0 4px 0 var(--text); outline: 4px solid transparent; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Generic stacked fields (for non-card pages) ---------- */
.form-group { margin-bottom: 22px; max-width: 46em; }
.form-group > label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--navy); }
.form-group .help { display: block; color: var(--muted); font-size: 15px; margin-bottom: 8px; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); padding: 14px 18px; font-size: 15px; margin-bottom: 20px; font-weight: 600; }
.alert-success { background: #e6f3ec; color: var(--success); border: 1px solid #b6dcc6; }
.alert-danger  { background: #fbeae9; color: #b3271e; border: 1px solid #f2c4c0; }
.alert-danger p { margin: 4px 0; }

/* ---------- Terms link + modal popup ---------- */
.terms-link {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--blue); font: inherit; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}
.terms-link:hover { color: var(--blue-dark); }

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(11, 12, 44, .55);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: var(--radius-card);
  width: 100%; max-width: 560px; max-height: 85vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(16, 24, 40, .25);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--hairline);
}
.modal-header h2 { font-family: var(--font-head); margin: 0; font-size: 22px; color: var(--navy); }
.modal-close {
  background: none; border: 0; cursor: pointer; line-height: 1;
  font-size: 26px; color: var(--muted); padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; font-size: 16px; line-height: 1.6; color: var(--text); }
.modal-body ol { margin: 0; padding-left: 22px; }
.modal-body li { margin-bottom: 12px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 24px 20px; border-top: 1px solid var(--hairline);
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid #e3e6eb; padding: 24px 0; color: var(--muted); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .field-row { flex-direction: column; gap: 12px; }
  .field-label { flex-basis: auto; }
  .page-heading h1 { font-size: 30px; }
  .card-actions { flex-direction: column-reverse; }
  .card-actions .btn { width: 100%; justify-content: center; }
}
