/* FILAMENT STUDENT LOGIN CSS */

:root {
      --bg:       #F4EFE6;
      --bg2:      #EBE5DA;
      --surface:  #FFFFFF;
      --border:   rgba(30,60,40,0.12);
      --border-strong: rgba(30,60,40,0.22);
      --gold:     #A07828;
      --gold-lt:  #d4a83a;
      --gold-dk:  #7A5A18;
      --green:    #1A5234;
      --green-lt: #256B44;
      --green-xl: #318056;
      --green-dark: #0E2E1C;
      --text:     #111C16;
      --muted:    #445C4E;
      --faint:    #7A9080;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { font-size: 16px; }

    html { overflow-x: hidden; }
    body { overflow-x: hidden;
      font-family: 'Raleway', sans-serif;
      -webkit-font-smoothing: antialiased;
      overflow: hidden;
      height: 100vh;
    }

    h1, h2, h3 { font-family: 'DM Serif Display', serif; line-height: 1.2; }

    /* ═══════════════════════════════════════════
       SPLIT LAYOUT — 50 / 50
    ═══════════════════════════════════════════ */
    .split {
      display: flex;
      height: 100vh;
    }

    /* ─────────────────────────────────────────
       LEFT PANEL — Branding
    ───────────────────────────────────────── */
    .split-brand {
      flex: 0 0 33%;
      background: linear-gradient(170deg, var(--green-dark) 0%, var(--green) 55%, #1a6b3e 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 64px 48px;
      position: relative;
      overflow: hidden;
      color: #fff;
    }

    /* Zellige pattern rendered via canvas */
    .split-brand::before { display: none; }
    .zellige-canvas {
      position: absolute; inset: 0;
      width: 100%; height: 100%;
      pointer-events: none;
    }

    /* Radial gold glow */
    .split-brand::after {
      content: '';
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: 500px; height: 500px;
      background: radial-gradient(circle, rgba(196,154,54,0.07) 0%, transparent 65%);
      pointer-events: none;
    }

    /* Arabic watermark */
    .brand-watermark {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      font-family: 'Amiri', serif;
      font-size: 22rem;
      color: rgba(255,255,255,0.025);
      pointer-events: none;
      line-height: 1;
      user-select: none;
    }

    .brand-content {
      position: relative; z-index: 1;
      max-width: 280px;
      text-align: center;
    }

    /* Logo centered */
    .brand-logo {
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 32px;
      text-decoration: none;
    }
    .brand-logo-icon {
      width: 88px; height: 88px; border-radius: 24px;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      display: flex; align-items: center; justify-content: center;
      backdrop-filter: blur(8px);
      transition: transform 0.3s, box-shadow 0.3s;
    }
    .brand-logo:hover .brand-logo-icon {
      transform: translateY(-3px) rotate(-3deg);
      box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    }

    .brand-name {
      font-family: 'DM Serif Display', serif;
      font-size: 2.4rem; color: #fff;
      text-align: center;
      margin-bottom: 10px;
    }
    .brand-sub {
      font-size: 0.88rem;
      color: rgba(255,255,255,0.45);
      line-height: 1.6;
      font-weight: 500;
      letter-spacing: 0.04em;
      text-align: center;
    }

    /* Ornament */
    .brand-ornament-top {
      display: flex; align-items: center; gap: 16px;
      margin-bottom: 36px;
      justify-content: center;
    }
    .brand-orn-line {
      width: 48px; height: 1px;
      background: linear-gradient(90deg, transparent, rgba(196,154,54,0.35));
    }
    .brand-orn-line:last-child {
      background: linear-gradient(90deg, rgba(196,154,54,0.35), transparent);
    }
    .brand-orn-diamond {
      width: 7px; height: 7px;
      border: 1.5px solid var(--gold-lt);
      transform: rotate(45deg);
      opacity: 0.5;
    }

    /* ─────────────────────────────────────────
       RIGHT PANEL — Form
    ───────────────────────────────────────── */
    .split-form {
      flex: 1;
      background: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 64px 72px;
      position: relative;
      overflow-y: auto;
    }

    /* Noise texture */
    .split-form::before {
      content: '';
      position: absolute; inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
      pointer-events: none; opacity: 0.3;
    }

    .form-container {
      width: 100%;
      max-width: 520px;
      position: relative; z-index: 1;
    }

    .form-greeting {
      font-size: 2.6rem;
      color: var(--text);
      margin-bottom: 10px;
      text-align: center;
    }
    .form-greeting-sub {
      font-size: 1.12rem;
      color: var(--faint);
      font-weight: 500;
      line-height: 1.6;
      margin-bottom: 44px;
      text-align: center;
    }

    /* Gold accent bar — centered */
    .form-accent {
      width: 56px; height: 3px;
      background: linear-gradient(90deg, var(--gold-dk), var(--gold-lt));
      border-radius: 3px;
      margin: 0 auto 40px;
    }

    /* ── FORM ELEMENTS ── */
    .form-group {
      display: flex; flex-direction: column; gap: 10px;
      margin-bottom: 28px;
    }
    .form-group label {
      font-size: 0.86rem; font-weight: 700;
      color: var(--muted); letter-spacing: 0.05em;
      text-transform: uppercase;
    }
    .form-group input[type="email"],
    .form-group input[type="password"],
    .form-group input[type="text"] {
      font-family: 'Raleway', sans-serif;
      font-size: 1.1rem; font-weight: 500;
      color: var(--text);
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 19px 24px;
      transition: border-color 0.3s, box-shadow 0.3s;
      outline: none; width: 100%;
    }
    .form-group input::placeholder {
      color: var(--faint); font-weight: 400;
    }
    .form-group input:focus {
      border-color: var(--green);
      box-shadow: 0 0 0 4px rgba(26,82,52,0.06);
    }

    /* Password wrapper */
    .pw-wrap { position: relative; }
    .pw-wrap input { padding-right: 58px; }
    .pw-toggle {
      position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
      background: none; border: none; cursor: pointer;
      color: var(--faint); padding: 4px;
      display: flex; align-items: center; justify-content: center;
      transition: color 0.2s;
    }
    .pw-toggle:hover { color: var(--green); }

    /* Options row */
    .login-options {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 32px; margin-top: 4px;
    }
    .remember-me {
      display: flex; align-items: center; gap: 9px; cursor: pointer;
    }
    .remember-me input[type="checkbox"] {
      width: 18px; height: 18px;
      accent-color: var(--green); cursor: pointer;
    }
    .remember-me span {
      font-size: 0.95rem; color: var(--muted); font-weight: 500;
    }
    .forgot-link {
      font-size: 0.95rem; color: var(--green);
      font-weight: 600; text-decoration: none;
      transition: color 0.2s;
    }
    .forgot-link:hover { color: var(--gold); }

    /* Submit — sweep fill */
    .btn-login {
      display: inline-flex; align-items: center; gap: 10px;
      padding: 20px 40px; border-radius: 14px;
      background: var(--green); color: #fff;
      font-family: 'Raleway', sans-serif;
      font-weight: 700; font-size: 1.1rem;
      letter-spacing: 0.02em;
      border: none; cursor: pointer;
      transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.4s ease;
      box-shadow: 0 4px 20px rgba(26,82,52,0.22);
      width: 100%; justify-content: center;
      position: relative; overflow: hidden; z-index: 1;
    }
    .btn-login::before {
      content: ''; position: absolute; inset: 0;
      background: linear-gradient(135deg, var(--green-lt) 0%, var(--green-xl) 100%);
      border-radius: inherit; z-index: -1;
      transform: scaleX(0); transform-origin: left center;
      transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .btn-login:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 28px rgba(26,82,52,0.3), 0 2px 8px rgba(26,82,52,0.12);
    }
    .btn-login:hover::before { transform: scaleX(1); }
    .btn-login svg { transition: transform 0.25s ease; flex-shrink: 0; }
    .btn-login:hover svg { transform: translateX(3px); }
    .btn-login:active { transform: translateY(0) scale(0.98); transition-duration: 0.1s; }

    /* Separator */
    .separator {
      display: flex; align-items: center; gap: 18px;
      margin: 28px 0;
    }
    .separator-line {
      flex: 1; height: 1px;
      background: var(--border);
    }
    .separator span {
      font-size: 0.82rem; color: var(--faint);
      font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    /* CTA inscription */
    .login-cta {
      text-align: center;
      font-size: 1.02rem;
      color: var(--muted);
      font-weight: 500;
    }
    .login-cta a {
      color: var(--green); font-weight: 700;
      text-decoration: none; transition: color 0.2s;
    }
    .login-cta a:hover { color: var(--gold); }

    /* Error state */
    .form-error {
      display: none;
      align-items: center; gap: 12px;
      padding: 14px 18px; border-radius: 12px;
      background: rgba(180,40,40,0.06);
      border: 1px solid rgba(180,40,40,0.15);
      margin-bottom: 24px;
    }
    .form-error.show { display: flex; }
    .form-error svg { flex-shrink: 0; }
    .form-error p {
      font-size: 0.95rem; color: #8B2020;
      font-weight: 500; line-height: 1.5;
    }

    /* ═══════════════════════ ANIMATIONS ═══════════════════════ */
    .fade-up {
      opacity: 0; transform: translateY(22px);
      animation: fadeUp 0.75s cubic-bezier(0.16,1,0.3,1) forwards;
    }
    .fade-up-d1 { animation-delay: 0.06s; }
    .fade-up-d2 { animation-delay: 0.13s; }
    .fade-up-d3 { animation-delay: 0.20s; }
    .fade-up-d4 { animation-delay: 0.28s; }
    .fade-up-d5 { animation-delay: 0.36s; }
    .fade-up-d6 { animation-delay: 0.44s; }
    .fade-up-d7 { animation-delay: 0.52s; }
    .fade-up-d8 { animation-delay: 0.60s; }

    @keyframes fadeUp {
      to { opacity: 1; transform: none; }
    }

    .slide-in {
      opacity: 0; transform: translateX(-28px);
      animation: slideIn 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
    }
    .slide-in-d1 { animation-delay: 0.08s; }
    .slide-in-d2 { animation-delay: 0.18s; }
    .slide-in-d3 { animation-delay: 0.28s; }
    .slide-in-d4 { animation-delay: 0.38s; }
    .slide-in-d5 { animation-delay: 0.48s; }
    .slide-in-d6 { animation-delay: 0.58s; }

    @keyframes slideIn {
      to { opacity: 1; transform: none; }
    }

    /* ═══════════════════════ RESPONSIVE ═══════════════════════ */
    @media (max-width: 960px) {
      .split { flex-direction: column; height: auto; }
      body { overflow-y: auto; height: auto; }

      .split-brand {
        flex: none;
        padding: 48px 32px 40px;
      }
      .brand-watermark { font-size: 12rem; }
      .brand-name { font-size: 1.8rem; }

      .split-form {
        padding: 44px 32px 56px;
      }
      .form-container { max-width: 440px; }
      .form-greeting { font-size: 1.65rem; }
    }

    @media (max-width: 480px) {
      .split-brand { padding: 36px 24px 28px; }
      .brand-name { font-size: 1.5rem; }
      .brand-logo-icon { width: 64px; height: 64px; border-radius: 18px; }

      .split-form { padding: 32px 22px 48px; }
      .form-greeting { font-size: 1.45rem; }
      .form-greeting-sub { font-size: 0.9rem; }
      .login-options {
        flex-direction: column; align-items: flex-start; gap: 14px;
      }
    }