/* ===================================================================
   login.css — Ghiras Academy
   Shared auth design for BOTH student and admin logins.
   A centered landscape card: brand image (left) + form (right),
   floating on a warm cream page. Student keeps the Google option.
   =================================================================== */

:root {
  --green:       #1f7a63;
  --green-deep:  #114a3a;
  --gold:        #b8993f;
  --gold-soft:   #caa85e;
  --gold-deep:   #a67c3c;
  --cream:       #faf2df;
  --cream2:      #f7efdd;
  --ink:         #16382d;
  --navy:        #2f4156;   /* heading color from the reference */
  --slate:       #94a1ac;   /* muted subtitle */
  --field:       #f6f3ec;
  --line:        #ece6d8;
  --white:       #ffffff;
  --ease:        cubic-bezier(.2, .7, .2, 1);
  --radius:      12px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  /* Ghiras calligraphy pattern. The repeating-gradients are a graceful
     fallback that shows only if login-bg.png is missing. */
  background-image:
    url('../img/login-bg.jpg'),
    repeating-linear-gradient( 62deg, rgba(184,153,63,.05) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(-62deg, rgba(184,153,63,.05) 0 2px, transparent 2px 46px);
  background-size: cover, auto, auto;
  background-position: center center, 0 0, 0 0;
  background-repeat: no-repeat, repeat, repeat;
  background-attachment: fixed, fixed, fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

img { max-width: 100%; display: block; }

/* ── Landscape card ────────────────────────────────────────────── */
.auth {
  width: 100%;
  max-width: 1040px;
  display: flex;
  justify-content: center;
}
.auth__card {
  display: flex;
  width: 100%;
  min-height: 580px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(17, 74, 58, .16);
  overflow: hidden;
  animation: authUp .5s var(--ease) both;
}
@keyframes authUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Left: brand image ─────────────────────────────────────────── */
.auth__brand {
  flex: 0 0 44%;
  max-width: 44%;
  background-image: url('../img/login.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--cream2);
}

/* ── Right: form column ────────────────────────────────────────── */
.auth__form {
  position: relative;
  flex: 1 1 56%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 58px;
}

/* Home / back-to-site icon */
.auth__home {
  position: absolute;
  top: 26px;
  right: 30px;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  border-radius: 9px;
  transition: background .15s, color .15s;
}
.auth__home:hover { background: rgba(184,153,63,.12); color: var(--gold-deep); }
.auth__home svg { width: 22px; height: 22px; }

/* Logo shown only when the brand panel is hidden (mobile) */
.auth__logo-mobile {
  display: none;
  width: 74px;
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 3px 10px rgba(31, 122, 99, .16));
}

/* ── Heading ───────────────────────────────────────────────────── */
.auth__head { text-align: center; margin-bottom: 28px; }
.auth__title {
  font-size: 2.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.auth__subtitle {
  font-size: .98rem;
  color: var(--slate);
  margin-top: 8px;
}

/* ── Social sign-in ────────────────────────────────────────────── */
.auth__social { margin-bottom: 18px; }
.auth__social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy);
  font-family: 'Poppins', sans-serif;
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.auth__social-btn:hover { background: #faf8f2; border-color: #ddd2b8; }
.auth__social-btn:active { transform: translateY(1px); }
.auth__social-btn svg { width: 19px; height: 19px; flex-shrink: 0; }

/* ── "or" divider ──────────────────────────────────────────────── */
.auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--slate);
  font-size: .78rem;
}
.auth__divider::before,
.auth__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Alerts ────────────────────────────────────────────────────── */
.auth__alert {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: .83rem;
  line-height: 1.5;
  margin-bottom: 18px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid transparent;
}
.auth__alert svg { flex-shrink: 0; margin-top: 1px; }
.auth__alert--error {
  background: rgba(201, 147, 74, .12);
  border-color: rgba(201, 147, 74, .38);
  color: #7a3b0a;
}
.auth__alert--info,
.auth__alert--success {
  background: rgba(31, 122, 99, .09);
  border-color: rgba(31, 122, 99, .28);
  color: var(--green-deep);
}

/* ── Form fields ───────────────────────────────────────────────── */
.auth__group { margin-bottom: 20px; }
.auth__label {
  display: block;
  font-size: .92rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.auth__input {
  width: 100%;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  font-family: 'Poppins', sans-serif;
  font-size: .95rem;
  color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
  outline: none;
}
.auth__input::placeholder { color: rgba(47, 65, 86, .42); }
.auth__input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 153, 63, .16);
  background-color: var(--white);
}

/* Password field with eye toggle */
.auth__pw { position: relative; }
.auth__pw .auth__input { padding-right: 46px; }
.auth__pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--slate);
  cursor: pointer;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.auth__pw-toggle:hover { color: var(--gold-deep); background: rgba(184,153,63,.1); }
.auth__pw-toggle svg { width: 19px; height: 19px; }

/* ── Submit button (gold) ──────────────────────────────────────── */
.auth__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 24px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(166, 124, 60, .30);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), opacity .16s;
}
.auth__submit:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(166, 124, 60, .38); }
.auth__submit:active { transform: translateY(0); opacity: .94; }
.auth__submit:disabled { opacity: .75; cursor: default; transform: none; }
.auth__submit svg { width: 16px; height: 16px; }

/* Secondary / outline button (e.g. Sign Up on the login page) */
.auth__submit--ghost {
  background: transparent;
  color: var(--green-deep);
  border: 1.5px solid rgba(31, 122, 99, .55);
  box-shadow: none;
  text-decoration: none;
}
.auth__submit--ghost:hover {
  background: rgba(31, 122, 99, .07);
  border-color: var(--green);
  box-shadow: 0 8px 20px rgba(17, 74, 58, .12);
}
.auth__submit--ghost svg { color: var(--green); }

/* "or" divider between primary and secondary actions */
.auth__or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: rgba(17, 74, 58, .5);
  font-size: .8rem;
  font-weight: 500;
}
.auth__or::before,
.auth__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(184, 153, 63, .28);
}

/* Small secondary link (e.g. admin → student login) */
.auth__altlink {
  margin-top: 20px;
  text-align: center;
  font-size: .84rem;
}
.auth__altlink a { color: var(--green); font-weight: 600; text-decoration: none; }
.auth__altlink a:hover { text-decoration: underline; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .auth__card { flex-direction: column; min-height: 0; max-width: 440px; margin: 0 auto; }
  .auth__brand { display: none; }
  .auth__form { padding: 40px 30px; }
  .auth__logo-mobile { display: block; }
  .auth__home { top: 18px; right: 20px; }
  .auth__title { font-size: 1.7rem; }
}
@media (max-width: 400px) {
  .auth__form { padding: 32px 22px; }
  .auth__title { font-size: 1.5rem; }
}
