@font-face { font-family: 'Cicero'; src: url('../fonts/Cicer.ttf') format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Cicero'; src: url('../fonts/CicerMed.ttf') format('truetype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Cicero'; src: url('../fonts/CicerBol.ttf') format('truetype'); font-weight: 700; font-style: normal; }

:root {
  --jc-green:      #006E73;
  --jc-green-2:    #005F27;
  --jc-blue:       #00A3C4;
  --jc-gold:       #C2A712;
  --ink:           #142629;
  --muted:         #617378;
  --line:          #d7e3e2;
  --surface:       #ffffff;
  --surface-soft:  #f4f8f7;
  --shadow:        0 24px 60px rgba(0, 76, 80, .10);
  --radius-xl:     28px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.login-page {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(0,163,196,.08), transparent 22%),
    radial-gradient(circle at left 20%, rgba(0,110,115,.06), transparent 26%),
    linear-gradient(180deg, #f8fbfa 0%, #f2f7f6 100%);
  display: grid;
  place-items: center;
  padding: 32px;
}

/* ---- Card : deux colonnes ---- */
.login-card {
  width: min(100%, 810px);
  background: rgba(255,255,255,.97);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

/* Barre dorée en haut */
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--jc-gold);
  z-index: 2;
}

/* ---- Colonne gauche : logo ---- */
.login-left {
  flex: 0 0 200px;
  overflow: hidden;
  padding: 20px;
  position: relative; /* nécessaire pour le voile */
}

/* Voile transparent sur le logo */
.login-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.65);
  pointer-events: none;
  z-index: 1;
}

.login-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 0;
}

/* ---- Colonne droite : titre + formulaire ---- */
.login-right {
  flex: 1;
  padding: 52px 40px 52px 0px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Brand block */
.brand-block {
  margin-bottom: 28px;
}

.brand-block h1 {
  margin: 0 0 6px;
  font-family: 'Cicero', Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.1;
  color: var(--ink);
  font-weight: bold;
}

.eyebrow {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--jc-green);
  font-weight: 700;
}

/* Flash messages */
.login-card .alert {
  border-radius: 12px;
  font-size: .875rem;
  margin-bottom: 1rem;
}

/* Annuler le box-shadow rouge global sur :invalid avant interaction */
.login-form input:invalid {
  box-shadow: none;
}
.login-form input:user-invalid {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .35);
  border-color: #dc3545;
}

/* Form */
.login-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus {
  border-color: var(--jc-blue);
  box-shadow: 0 0 0 4px rgba(0,163,196,.10);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.forgot-link {
  color: var(--jc-green);
  font-weight: 600;
  font-size: .875rem;
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

.create-link {
  color: var(--jc-green);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}
.create-link:hover { text-decoration: underline; }

.login-button {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 14px;
  background: var(--jc-green-2);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.login-button:hover { background: #054b2a; }

/* ---- Mobile : empilement vertical ---- */
@media (max-width: 600px) {
  body.login-page { padding: 16px; }

  .login-card {
    flex-direction: column;
  }

  .login-left {
    flex: none;
    height: 200px;
    padding-top: 6px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .login-right { padding: 28px 24px 32px; }
}
