/* ==========================================================================
   MINEFOP - entry portal (served at the root of the domain)

   Reproduces the Ministry's portal design: a white card floating on the blue
   national gradient, flanked by two columns of institution tiles, with the
   bilingual doors into the site at its centre.

   Self-contained on purpose. The portal loads only its own typefaces, the
   vendored icon font and this stylesheet - the particle field is
   hand-written, so no third-party script or image is ever requested.
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;
  background: linear-gradient(135deg, #0c3c20, #27d770);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

img { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: #fff;
  color: #004a1f;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 4px;
}

.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid #ffcc00;
  outline-offset: 3px;
}

/* --------------------------------------------------------------- container */
.portal-container {
  width: 90%;
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  margin: 20px auto;
  transform: scale(0.95);
  transform-origin: center;
  animation: container-enter 1s ease-out forwards;
}

@keyframes container-enter {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.portal-header {
  background: linear-gradient(135deg, #004a1f, #00672b);
  color: white;
  padding: 20px;
  text-align: center;
  border-bottom: 5px solid #ffcc00;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.portal-header h1 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.portal-header p {
  font-size: 16px;
  opacity: 0.9;
  margin-top: 5px;
  font-weight: 300;
}

.portal-header .slogan {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-top: 10px;
  color: #ffcc00;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 1;
}

.portal-content {
  padding: 20px;
  position: relative;
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
  position: relative;
  z-index: 2;
}

.col { padding: 10px; }

.col-sm-2 {
  flex: 0 0 16.66667%;
  max-width: 16.66667%;
}

.col-sm-8 {
  flex: 0 0 66.66667%;
  max-width: 66.66667%;
}

@media (max-width: 992px) {
  .col-sm-2 {
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
  }
  .col-sm-8 {
    flex: 0 0 66.66667%;
    max-width: 66.66667%;
  }
}

@media (max-width: 768px) {
  .col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* --------------------------------------------------------- institution tile */
.institution-grid { list-style: none; }

.bloc {
  background: linear-gradient(135deg, #2ecc71 0%, #e74c3c 50%, #f1c40f 100%);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid #e9f4ee;
  height: 150px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bloc:hover,
.bloc:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.bloc > a {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.bloc img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  padding: 15px;
  transition: all 0.4s ease;
}

.bloc:hover img,
.bloc:focus-within img { transform: scale(0.9); }

/* Stand-in for a partner whose logo the Ministry has not supplied yet: the
   acronym set on the same tricolour tile, so the grid stays even. */
.bloc-acronym {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 15px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.4s ease;
  overflow-wrap: anywhere;
}

.bloc:hover .bloc-acronym,
.bloc:focus-within .bloc-acronym { transform: scale(0.9); }

.title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(100%);
  transition: transform 0.4s ease;
  z-index: 2;
}

.bloc:hover .title,
.bloc:focus-within .title { transform: translateY(0); }

.title h2 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 5px;
  line-height: 1.3;
}

.title span {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  display: block;
}

/* --------------------------------------------------------------- centre card */
.portail {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  text-align: center;
  border: 1px solid #d9e9e0;
  position: relative;
  overflow: hidden;
  animation: portail-enter 1s ease-out;
}

@keyframes portail-enter {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.title-minjec {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  position: relative;
}

.logo {
  padding: 0 15px;
  flex: 1;
  z-index: 2;
}

.logo img {
  max-height: 90px;
  width: auto;
  background: transparent;
  transition: transform 0.3s ease;
}

.logo img:hover { transform: scale(1.05); }

.title-minjec-text {
  padding: 0 20px;
  flex: 4;
  z-index: 2;
}

.title-minjec-text h1,
.title-minjec-text .tm-name {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #00672b;
  margin: 10px 0;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.title-minjec-text h2,
.title-minjec-text .tm-programme {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #e67e22;
  margin: 8px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.title-minjec-text h3,
.title-minjec-text .tm-republic {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #254231;
  margin: 8px 0;
}

.title-minjec-text p {
  margin: 4px 0;
  font-size: 18px;
  color: #7f8c8d;
}

.after-title { margin: 25px 0; }

.button-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-minefop {
  font-family: 'Poppins', system-ui, sans-serif;
  background: linear-gradient(135deg, #00672b, #004a1f);
  color: white !important;
  border: none;
  padding: 14px 35px;
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 6px 15px rgba(0, 103, 43, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-minefop:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #004a1f, #00672b);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.btn-minefop:hover,
.btn-minefop:focus-visible {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 103, 43, 0.5);
}

.btn-minefop:hover:before,
.btn-minefop:focus-visible:before { opacity: 1; }

.btn-minefop i {
  margin-right: 10px;
  font-size: 20px;
}

.but-portail {
  margin-top: 25px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  border: 1px solid #d9e9e0;
  position: relative;
  z-index: 2;
}

.but-portail p {
  margin: 10px 0;
  font-size: 17px;
  color: #254231;
  font-weight: 500;
}

/* Locally drawn reassurance badge - the original trust seal was an image
   fetched from a third party, which this site never does. */
.security-badge {
  margin-top: 20px;
  text-align: center;
}

.security-badge span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid #cfe0d3;
  border-radius: 6px;
  background: #f2f8f4;
  color: #1e6b43;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.security-badge i { font-size: 17px; }

/* ------------------------------------------------------------------ chrome */
.portal-footer {
  background: linear-gradient(135deg, #004a1f, #003516);
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-footer p { margin: 5px 0; }

.portal-footer a {
  color: #ffcc00;
  text-decoration: none;
}

.portal-footer a:hover,
.portal-footer a:focus-visible { text-decoration: underline; }

.portal-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 10px 0;
}

.year-tag {
  position: absolute;
  /* The card clips its overflow, so the badge sits just inside the top edge
     rather than straddling it. */
  top: 14px;
  right: 30px;
  background: linear-gradient(135deg, #ffcc00, #ffaa00);
  color: #00672b;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: bold;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 16px;
  z-index: 10;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transform: rotate(3deg);
}

.pattern-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 10% 20%, rgba(0, 103, 43, 0.03) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(230, 126, 34, 0.03) 0%, transparent 20%);
  pointer-events: none;
  z-index: 1;
}

/* ---------------------------------------------------------- mobile styles */
@media (max-width: 1000px) {
  body { padding: 0; align-items: flex-start; }

  .portal-container {
    width: 100%;
    margin: 0;
    border-radius: 0;
    animation: none;
    box-shadow: none;
    transform: none;
    opacity: 1;
  }

  .portal-header {
    padding: 12px 15px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .portal-header h1 {
    font-size: 16px;
    margin-bottom: 3px;
  }

  .portal-header p { font-size: 12px; }
  .portal-header .slogan { font-size: 13px; margin-top: 6px; }

  .title-minjec {
    flex-direction: column;
    margin-bottom: 10px;
  }

  .title-minjec-text {
    padding: 0;
    text-align: center;
    order: 2;
    margin-top: 10px;
  }

  .title-minjec-text h1,
  .title-minjec-text .tm-name {
    font-size: 14px;
    margin: 3px 0;
    line-height: 1.3;
  }

  .title-minjec-text h2,
  .title-minjec-text .tm-programme { font-size: 13px; margin: 3px 0; }
  .title-minjec-text h3,
  .title-minjec-text .tm-republic { font-size: 12px; margin: 3px 0; }
  .title-minjec-text p,
  .title-minjec-text .tm-motto { font-size: 11px; margin: 2px 0; }

  .logo {
    padding: 0;
    text-align: center;
    margin: 5px 0;
  }

  .logo img { max-height: 50px; }
  .logo:first-child { order: 1; }
  .logo:last-child { order: 3; }

  .but-portail p { font-size: 12px; margin: 3px 0; }

  .button-group {
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
  }

  .btn-minefop {
    padding: 12px 15px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 103, 43, 0.3);
  }

  .row {
    flex-direction: column;
    margin: 0;
  }

  .col-sm-2, .col-sm-8 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 5px;
  }

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

  .bloc {
    height: 120px;
    margin-bottom: 0;
  }

  .bloc img {
    height: 65px;
    padding: 8px;
    margin-top: 0;
  }

  .bloc-acronym { font-size: 16px; padding: 8px; }

  /* Always show the name on mobile: there is no hover to reveal it. */
  .title {
    position: static;
    transform: none;
    padding: 8px;
    background: rgba(0, 0, 0, 0.75);
  }

  .bloc > a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .title h2 { font-size: 11px; }
  .title span { font-size: 9px; }

  .year-tag {
    top: 8px;
    right: 10px;
    padding: 4px 12px;
    font-size: 12px;
  }

  .portal-footer { padding: 12px; font-size: 12px; }
  .portail { padding: 15px; }
  .after-title { margin: 15px 0; }
}

@media (max-width: 480px) {
  .institution-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-header h1 { font-size: 14px; }
  .portal-header p { font-size: 11px; }
  .btn-minefop { font-size: 13px; padding: 10px 12px; }
  .title-minjec-text h1,
  .title-minjec-text .tm-name { font-size: 12px; }
  .title-minjec-text h2,
  .title-minjec-text .tm-programme { font-size: 11px; }
  .title-minjec-text h3,
  .title-minjec-text .tm-republic { font-size: 11px; }
  .bloc { height: 110px; }
  .bloc img { height: 60px; }
  .bloc-acronym { font-size: 14px; }
  .title h2 { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-container,
  .portail { animation: none; }

  .bloc,
  .bloc img,
  .bloc-acronym,
  .btn-minefop,
  .logo img { transition: none; }

  .bloc:hover,
  .bloc:focus-within,
  .btn-minefop:hover,
  .btn-minefop:focus-visible { transform: none; }
}

@media print {
  body { background: #fff; }
  #particles-js,
  .button-group { display: none !important; }
  .portal-container { box-shadow: none; }
}
