/* ============================================================
   index.css — Login page & landing section
   Only loaded on index.php
   ============================================================ */

/* ── Design tokens (index-only) ───────────────────────────── */

:root {
  --idx-green:       #3d6b47;
  --idx-green-dark:  #2a4d33;
  --idx-green-light: #edf4ef;
  --idx-cream:       #faf8f4;
  --idx-text:        #2c2c2c;
  --idx-muted:       #6b7280;
  --idx-shadow-sm:   0 2px 8px rgba(0,0,0,0.10);
  --idx-shadow-md:   0 6px 28px rgba(0,0,0,0.16);
}

/* ── Reset leftovers for index ────────────────────────────── */

body {
  background: var(--idx-cream);
  color: var(--idx-text);
}

/* Hide the container/row/bloc structure — we use index-specific layout */
.container { padding: 0; }

/* ── Hero ─────────────────────────────────────────────────── */

.idx-hero {
  position: relative;
  background: url('../img/nouvelle-implantation-forge.jpg') center 40% / cover no-repeat;
  min-height: 400px;
  display: flex;
  align-items: center;
}

.idx-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(30, 58, 38, 0.88) 0%,
    rgba(30, 58, 38, 0.72) 55%,
    rgba(30, 58, 38, 0.40) 100%
  );
}

.idx-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* ── Brand (logo + tagline) ───────────────────────────────── */

.idx-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.idx-brand img {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.idx-tagline {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.idx-tagline em {
  font-style: normal;
  color: #a8d5b5;
}

/* ── Login card ───────────────────────────────────────────── */

.idx-login-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 24px;
  box-shadow: var(--idx-shadow-md);
  width: 280px;
  flex-shrink: 0;
}

.idx-login-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--idx-green-dark);
  margin: 0 0 20px;
  letter-spacing: 0.01em;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.login-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--idx-muted);
}

.login-field input {
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--font-base);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fdfdfd;
  color: var(--idx-text);
}

.login-field input:focus {
  outline: none;
  border-color: var(--idx-green);
  box-shadow: 0 0 0 3px rgba(61, 107, 71, 0.15);
  background: #fff;
}

.login-submit {
  width: 100%;
  margin-top: 6px;
  padding: 10px 16px !important;
  background-color: var(--idx-green) !important;
  border-radius: 7px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
  min-height: 0 !important;
}

.login-submit:hover {
  background-color: var(--idx-green-dark) !important;
  box-shadow: 0 2px 8px rgba(30,58,38,0.25);
}

/* ── Info section (below hero) ────────────────────────────── */

.idx-info {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.idx-info-heading {
  text-align: center;
  margin: 0 0 36px;
}

.idx-info-heading h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--idx-green-dark);
  margin: 0 0 6px;
}

.idx-info-heading p {
  font-size: 14px;
  color: var(--idx-muted);
  margin: 0;
}

/* ── Info cards grid ──────────────────────────────────────── */

.idx-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.idx-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 20px 18px;
  box-shadow: var(--idx-shadow-sm);
  border-top: 3px solid var(--idx-green);
  transition: box-shadow 0.2s, transform 0.2s;
}

.idx-card:hover {
  box-shadow: var(--idx-shadow-md);
  transform: translateY(-2px);
}

.idx-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.idx-card-header img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
  opacity: 0.85;
}

.idx-card-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--idx-green-dark);
}

.idx-card-body {
  font-size: 13.5px;
  line-height: 1.7;
  color: #444;
}

.idx-card-body a {
  color: var(--idx-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.idx-card-body b {
  color: var(--idx-text);
}

/* "C'est quoi" card spans 2 rows on desktop to fill the space */
.idx-card--wide {
  grid-column: span 2;
}

/* ── Warning (login error) ────────────────────────────────── */

.idx-login-card .warning {
  margin-top: 10px;
  border-radius: 6px;
  font-size: 13px;
}

/* ── Mobile ───────────────────────────────────────────────── */

@media (max-width: 820px) {
  .idx-grid {
    grid-template-columns: 1fr 1fr;
  }

  .idx-card--wide {
    grid-column: span 2;
  }
}

/* ── Forgot-password link ─────────────────────────────────── */

.idx-forgot-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--idx-muted);
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.idx-forgot-link:hover {
  color: var(--idx-green);
}

/* ── Modal backdrop ───────────────────────────────────────── */

.idx-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.idx-modal-backdrop[hidden] {
  display: none;
}

/* ── Modal card ───────────────────────────────────────────── */

.idx-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  animation: idx-modal-in 0.18s ease;
}

@keyframes idx-modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

.idx-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #ececec;
}

.idx-modal-header span {
  font-size: 15px;
  font-weight: 700;
  color: var(--idx-green-dark);
  letter-spacing: 0.01em;
}

.idx-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--idx-muted);
  padding: 0 2px;
  transition: color 0.15s;
}

.idx-modal-close:hover {
  color: var(--idx-text);
}

.idx-modal-body {
  padding: 18px 20px 14px;
}

.idx-modal-body p {
  font-size: 13px;
  color: var(--idx-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* re-use .login-field inside modal but override label/input colors for white bg */
.idx-modal .login-field label {
  color: var(--idx-muted);
}

.idx-modal .login-field input {
  color: var(--idx-text);
}

.idx-modal-error {
  font-size: 13px;
  color: crimson;
  background: lavenderblush;
  border: 1px solid crimson;
  border-radius: 6px;
  padding: 7px 10px;
  margin-top: 8px;
}

.idx-modal-info {
  font-size: 13px;
  color: forestgreen;
  background: cornsilk;
  border: 1px solid forestgreen;
  border-radius: 6px;
  padding: 7px 10px;
  margin-top: 8px;
}

.idx-modal-footer {
  padding: 0 20px 20px;
}

.idx-modal-btn {
  width: 100%;
  padding: 10px 16px;
  background-color: var(--idx-green);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.idx-modal-btn:hover:not(:disabled) {
  background-color: var(--idx-green-dark);
  box-shadow: 0 2px 8px rgba(30, 58, 38, 0.25);
}

.idx-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Toast ────────────────────────────────────────────────── */

.idx-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--idx-green-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 100px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 2000;
  white-space: nowrap;
}

.idx-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .idx-hero-inner {
    flex-direction: column;
    align-items: center;
    padding: 36px 20px;
    gap: 24px;
  }

  .idx-brand {
    align-items: center;
    text-align: center;
  }

  .idx-brand img {
    width: 140px;
  }

  .idx-tagline {
    font-size: 17px;
    text-align: center;
  }

  .idx-login-card {
    width: 100%;
    max-width: 360px;
  }

  .idx-grid {
    grid-template-columns: 1fr;
  }

  .idx-card--wide {
    grid-column: span 1;
  }

  .idx-info {
    padding: 32px 16px 48px;
  }
}
