/* ============================================================
   Institut Polytechnique Gloris — Site indépendant
   Palette "tech / soft", pensée pour rassurer élèves, parents et
   entreprises sur la crédibilité et le sérieux de l'établissement.
   ============================================================ */

:root {
  --ipg-indigo: #3B4B8C;
  --ipg-indigo-dark: #262F5E;
  --ipg-indigo-light: #EBEEFA;
  --ipg-teal: #21B8AE;
  --ipg-teal-dark: #178E86;
  --ipg-amber: #F2A93B;
  --ipg-ink: #2B2E38;
  --ipg-grey: #667085;
  --ipg-light: #F4F6FB;
  --font-heading: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  color: var(--ipg-ink);
  background: #fff;
}

h1, h2, h3, h4, .navbar-brand, .btn {
  font-family: var(--font-heading);
}

a { color: var(--ipg-indigo); }
a:hover { color: var(--ipg-teal-dark); }

.section-pad { padding: 90px 0; }
@media (max-width: 767px) { .section-pad { padding: 55px 0; } }

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ipg-teal-dark);
  margin-bottom: 10px;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--ipg-indigo-dark);
  margin-bottom: 18px;
}

.section-lead {
  color: var(--ipg-grey);
  max-width: 680px;
  margin-bottom: 0;
}

/* ---------- Bandeau de retour au portail ---------- */
.group-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1031;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ipg-indigo-dark);
  color: rgba(255,255,255,0.9);
  font-size: 13px;
}

.group-bar a { color: #fff; font-weight: 600; text-decoration: none; }
.group-bar a:hover { color: var(--ipg-amber); }

/* ---------- Navbar ---------- */
.navbar-gloris {
  background: #fff;
  box-shadow: 0 2px 16px rgba(43, 46, 56, 0.08);
  padding: 10px 0;
}

.navbar-gloris.fixed-top { top: 34px; }

.navbar-gloris .navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--ipg-indigo-dark);
  line-height: 1.15;
}

.navbar-gloris .navbar-brand img {
  height: 48px;
  width: 48px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--ipg-indigo-light);
}

.navbar-gloris .navbar-brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--ipg-grey);
}

.navbar-gloris .nav-link {
  font-weight: 600;
  color: var(--ipg-ink);
  padding: 10px 12px !important;
  white-space: nowrap;
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .navbar-gloris .nav-link { padding: 10px 8px !important; font-size: 14.5px; }
  .navbar-gloris .btn-gloris { padding: 9px 16px; font-size: 14.5px; }
}

.navbar-gloris .nav-link:hover,
.navbar-gloris .nav-link.active {
  color: var(--ipg-indigo);
}

.navbar-gloris .dropdown-menu {
  border: none;
  box-shadow: 0 10px 30px rgba(43, 46, 56, 0.14);
  border-radius: 12px;
  padding: 8px;
}

.navbar-gloris .dropdown-item {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ipg-ink);
}

.navbar-gloris .dropdown-item:hover,
.navbar-gloris .dropdown-item:focus {
  background: var(--ipg-indigo-light);
  color: var(--ipg-indigo-dark);
}

.btn-gloris {
  background: var(--ipg-indigo);
  border: 1px solid var(--ipg-indigo);
  color: #fff;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
  transition: 0.25s;
  display: inline-block;
}

.btn-gloris:hover {
  background: var(--ipg-indigo-dark);
  border-color: var(--ipg-indigo-dark);
  color: #fff;
}

.btn-gloris-outline {
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
  transition: 0.25s;
  display: inline-block;
}

.btn-gloris-outline:hover { background: #fff; color: var(--ipg-indigo-dark); }

.btn-outline-gloris {
  border: 1.5px solid var(--ipg-indigo);
  color: var(--ipg-indigo);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 8px;
  transition: 0.25s;
  display: inline-block;
}

.btn-outline-gloris:hover { background: var(--ipg-indigo); color: #fff; }

/* ---------- Hero ---------- */
#hero {
  position: relative;
  padding: 160px 0 120px;
  background: linear-gradient(135deg, var(--ipg-indigo) 0%, var(--ipg-indigo-dark) 100%);
  overflow: hidden;
  color: #fff;
}

#hero.has-photo { background-size: cover; background-position: center; }

#hero.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59,75,140,0.88) 0%, rgba(38,47,94,0.9) 100%);
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 12% 20%, rgba(33,184,174,0.22) 0, transparent 42%),
                     radial-gradient(circle at 88% 15%, rgba(242,169,59,0.18) 0, transparent 40%);
  pointer-events: none;
}

#hero .container { position: relative; z-index: 1; }

#hero .hero-eyebrow {
  color: var(--ipg-amber);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 13px;
}

#hero h1 { font-size: 46px; font-weight: 700; margin: 14px 0 18px; }

#hero .hero-tagline {
  font-size: 19px;
  font-weight: 400;
  color: rgba(255,255,255,0.9);
  max-width: 640px;
  margin-bottom: 30px;
}

.hero-page { padding: 130px 0 60px; }
.hero-page h1 { font-size: 34px; margin: 10px 0 0; }

@media (max-width: 767px) {
  #hero { padding: 130px 0 80px; }
  #hero h1 { font-size: 28px; }
  #hero .hero-tagline { font-size: 16px; }
  .hero-page { padding: 110px 0 50px; }
}

/* ---------- Stat strip ---------- */
.stat-strip { background: var(--ipg-light); border-top: 1px solid #e3e7f5; border-bottom: 1px solid #e3e7f5; }

.stat-item { text-align: center; padding: 26px 10px; }
.stat-item i { font-size: 30px; color: var(--ipg-teal-dark); margin-bottom: 10px; display: inline-block; }
.stat-item h3 { font-size: 16px; font-weight: 700; color: var(--ipg-ink); margin: 0; }

/* ---------- Cards ---------- */
.info-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eaedf7;
  box-shadow: 0 10px 28px rgba(43, 46, 56, 0.06);
  overflow: hidden;
  height: 100%;
  transition: transform 0.25s, box-shadow 0.25s;
}

.info-card:hover { transform: translateY(-6px); box-shadow: 0 18px 38px rgba(43, 46, 56, 0.13); }

.info-card .card-banner {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--ipg-indigo), var(--ipg-indigo-dark));
}

.info-card .card-banner.banner-teal { background: linear-gradient(135deg, var(--ipg-teal), var(--ipg-teal-dark)); }
.info-card .card-banner.banner-amber { background: linear-gradient(135deg, #FFC777, var(--ipg-amber)); color: var(--ipg-ink); }

.info-card .card-body-cg { padding: 26px 24px; }
.info-card .card-tag { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ipg-teal-dark); }
.info-card h3 { font-size: 19px; font-weight: 700; color: var(--ipg-indigo-dark); margin: 6px 0 10px; }
.info-card p { color: var(--ipg-grey); font-size: 15px; margin-bottom: 16px; }

/* ---------- About / founder ---------- */
.founder-section { background: var(--ipg-indigo-light); }

.founder-portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--ipg-indigo);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 20px;
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(38, 47, 94, 0.18);
  overflow: hidden;
}

.founder-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.founder-quote {
  font-size: 18px;
  font-style: italic;
  color: var(--ipg-ink);
  border-left: 3px solid var(--ipg-amber);
  padding-left: 20px;
  margin-bottom: 22px;
}

.founder-signature { font-weight: 700; color: var(--ipg-indigo-dark); }

/* ---------- Value props ---------- */
.value-box {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(43, 46, 56, 0.06);
  height: 100%;
}

.value-box .value-icon {
  flex: 0 0 48px;
  height: 48px;
  width: 48px;
  border-radius: 50%;
  background: var(--ipg-indigo-light);
  color: var(--ipg-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.value-box h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--ipg-ink); }
.value-box p { font-size: 14px; color: var(--ipg-grey); margin: 0; }

/* ---------- Filières (catalogue) ---------- */
.filiere-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eaedf7;
  box-shadow: 0 10px 28px rgba(43, 46, 56, 0.06);
  height: 100%;
  overflow: hidden;
}

.filiere-card .filiere-head {
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--ipg-indigo), var(--ipg-indigo-dark));
  color: #fff;
}

.filiere-card .filiere-head .filiere-code {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
}

.filiere-card .filiere-body { padding: 22px 24px; }
.filiere-card .filiere-body dt { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ipg-teal-dark); font-weight: 700; margin-top: 12px; }
.filiere-card .filiere-body dt:first-child { margin-top: 0; }
.filiere-card .filiere-body dd { color: var(--ipg-grey); font-size: 14px; margin-bottom: 0; }

/* ---------- Admissions : étapes, tarifs, FAQ ---------- */
.step-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eaedf7;
  padding: 24px;
  height: 100%;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ipg-indigo);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.fee-table { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid #eaedf7; }
.fee-table th { background: var(--ipg-indigo-light); color: var(--ipg-indigo-dark); font-weight: 700; }

.placeholder-note {
  display: inline-block;
  background: #FFF6E5;
  color: #8a6416;
  border: 1px dashed var(--ipg-amber);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12.5px;
  font-style: italic;
}

.accordion-cg .accordion-button { font-weight: 700; color: var(--ipg-indigo-dark); font-family: var(--font-heading); }
.accordion-cg .accordion-button:not(.collapsed) { background: var(--ipg-indigo-light); color: var(--ipg-indigo-dark); box-shadow: none; }
.accordion-cg .accordion-button:focus { box-shadow: none; border-color: var(--ipg-indigo); }

/* ---------- Règlement intérieur ---------- */
.reglement-toc {
  background: var(--ipg-indigo-light);
  border-radius: 14px;
  padding: 22px 24px;
  position: sticky;
  top: 100px;
}

.reglement-toc h5 { color: var(--ipg-indigo-dark); font-weight: 700; margin-bottom: 12px; }
.reglement-toc ul { list-style: none; padding: 0; margin: 0; }
.reglement-toc li { margin-bottom: 8px; }
.reglement-toc a { color: var(--ipg-ink); font-size: 14px; font-weight: 600; }
.reglement-toc a:hover { color: var(--ipg-indigo); }

.reglement-article { margin-bottom: 40px; scroll-margin-top: 100px; }

.reglement-article h2 {
  color: var(--ipg-indigo-dark);
  font-size: 22px;
  font-weight: 700;
  border-bottom: 2px solid var(--ipg-indigo-light);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.reglement-article h3 { color: var(--ipg-ink); font-size: 16px; font-weight: 700; margin: 18px 0 8px; }
.reglement-article p, .reglement-article li { color: var(--ipg-grey); font-size: 15px; line-height: 1.75; }

/* ---------- Entreprises ---------- */
.partner-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eaedf7;
  padding: 24px;
  height: 100%;
  text-align: center;
}

.partner-card i { font-size: 30px; color: var(--ipg-teal-dark); margin-bottom: 12px; display: inline-block; }

/* ---------- Actualités ---------- */
.news-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eaedf7;
  overflow: hidden;
  height: 100%;
  transition: transform 0.25s, box-shadow 0.25s;
}

.news-card:hover { transform: translateY(-6px); box-shadow: 0 18px 38px rgba(43, 46, 56, 0.13); }

.news-card .news-banner {
  height: 160px;
  background: linear-gradient(135deg, var(--ipg-indigo), var(--ipg-indigo-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 34px;
}

.news-card .news-date { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ipg-teal-dark); }
.news-card .news-body { padding: 22px 22px 24px; }
.news-card h3 { font-size: 17px; font-weight: 700; color: var(--ipg-indigo-dark); margin: 8px 0 10px; }
.news-card p { color: var(--ipg-grey); font-size: 14px; }

/* ---------- Galerie ---------- */
.gallery-item { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery-item:hover img { transform: scale(1.06); }

.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(38,47,94,0.78), transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.25s;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item .gallery-overlay span { color: #fff; font-weight: 600; font-size: 14px; }

/* ---------- Contact ---------- */
.contact-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eaedf7;
  box-shadow: 0 10px 28px rgba(43, 46, 56, 0.06);
  padding: 26px;
  height: 100%;
}

.contact-card i { font-size: 24px; color: var(--ipg-indigo); margin-bottom: 12px; display: inline-block; }
.contact-card h4 { font-size: 15px; font-weight: 700; color: var(--ipg-ink); margin-bottom: 6px; }
.contact-card p, .contact-card a { color: var(--ipg-grey); font-size: 14px; }

.form-cg .form-control, .form-cg .form-select { border-radius: 10px; border: 1px solid #dde1f0; padding: 12px 14px; }
.form-cg .form-control:focus, .form-cg .form-select:focus { border-color: var(--ipg-indigo); box-shadow: 0 0 0 0.2rem rgba(59, 75, 140, 0.15); }

.map-frame { border-radius: 16px; overflow: hidden; border: 1px solid #eaedf7; height: 100%; min-height: 320px; }
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

/* ---------- Footer ---------- */
#footer { background: var(--ipg-indigo-dark); color: rgba(255,255,255,0.85); padding: 70px 0 0; }
#footer h5 { color: #fff; font-weight: 700; font-size: 16px; margin-bottom: 18px; }
#footer ul { list-style: none; padding: 0; margin: 0; }
#footer ul li { margin-bottom: 10px; font-size: 14px; }
#footer a { color: rgba(255,255,255,0.75); }
#footer a:hover { color: var(--ipg-amber); }

#footer .footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
#footer .footer-logo img { height: 46px; width: 46px; border-radius: 50%; background: #fff; padding: 2px; }

#footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  margin-right: 8px;
  transition: 0.25s;
}

#footer .social-links a:hover { background: var(--ipg-amber); color: var(--ipg-indigo-dark); }

#footer .copy {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 40px;
  padding: 20px 0;
  font-size: 13px;
  text-align: center;
  color: rgba(255,255,255,0.6);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 20px;
  bottom: 20px;
  z-index: 996;
  background: var(--ipg-indigo);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  transition: all 0.3s;
}

.back-to-top:hover { background: var(--ipg-indigo-dark); color: #fff; }
.back-to-top.active { visibility: visible; opacity: 1; }

/* ---------- Gloris Assist (chatbox) ---------- */
.gloris-chat-widget { position: fixed; right: 20px; bottom: 78px; z-index: 1050; }

.gloris-chat-toggle {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--ipg-indigo); color: #fff; font-size: 24px;
  box-shadow: 0 10px 24px rgba(38, 47, 94, 0.32); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s;
}
.gloris-chat-toggle:hover, .gloris-chat-toggle.active { transform: scale(1.06); background: var(--ipg-indigo-dark); }

.gloris-chat-panel {
  position: fixed; right: 20px; bottom: 144px; width: 340px; max-width: calc(100vw - 40px);
  height: 460px; max-height: calc(100vh - 180px);
  background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.22);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: all 0.25s; z-index: 1050;
}
.gloris-chat-panel.active { opacity: 1; visibility: visible; transform: translateY(0); }

.gloris-chat-header {
  background: var(--ipg-indigo-dark); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; font-weight: 700;
  font-family: var(--font-heading);
}
.gloris-chat-header button { background: none; border: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

.gloris-chat-messages { flex: 1; overflow-y: auto; padding: 14px; background: var(--ipg-indigo-light); }
.gloris-chat-msg { max-width: 85%; margin-bottom: 10px; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.gloris-chat-msg-bot { background: #fff; border: 1px solid rgba(0,0,0,0.08); color: #333; border-bottom-left-radius: 4px; }
.gloris-chat-msg-user { background: var(--ipg-indigo); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.gloris-chat-link { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--ipg-indigo-dark); }
.gloris-chat-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gloris-chat-quick button { background: #fff; border: 1.5px solid var(--ipg-indigo); color: var(--ipg-indigo); border-radius: 20px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.gloris-chat-quick button:hover { background: var(--ipg-indigo); color: #fff; }

.gloris-chat-form { display: flex; border-top: 1px solid rgba(0,0,0,0.08); padding: 8px; gap: 8px; background: #fff; }
.gloris-chat-form input { flex: 1; border: 1px solid #dde1f0; border-radius: 20px; padding: 8px 14px; font-size: 13.5px; outline: none; }
.gloris-chat-form input:focus { border-color: var(--ipg-indigo); }
.gloris-chat-form button { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--ipg-indigo); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

@media (max-width: 420px) {
  .gloris-chat-panel { right: 10px; left: 10px; width: auto; bottom: 138px; }
  .gloris-chat-widget { right: 10px; }
}
