/* =========================================================
   Eduins – Login page
   Mobile-first. No external fonts or libraries.
   ========================================================= */

:root {
  --blue-600: #0b5fe3;      /* primary button / icon blocks */
  --blue-700: #0849b5;      /* hover / pressed */
  --blue-link: #0757d8;     /* links (AA on white) */
  --navy: #14106b;          /* heading */
  --text: #1f2937;
  --text-muted: #4b5563;
  --placeholder: #6b7280;   /* 4.8:1 on input bg */
  --input-bg: #f6f8fc;
  --border: #d6dce7;
  --muted-icon: #8a94a6;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --card-bg: #ffffff;
  --focus: #1d4ed8;

  --radius-card: 18px;
  --radius-control: 8px;
  --control-h: 46px;
  --icon-w: 46px;

  --font: "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Bengali", "Noto Sans Devanagari", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 55%, #f4f8ff 100%);
  overflow-x: hidden;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Decorative background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg__waves {
  position: absolute;
  bottom: 0;
  width: 75vw;
  height: 70vh;
}
.bg__waves--left  { left: 0; }
.bg__waves--right { right: 0; }

.bg__circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #eaf2ff 0%, #dbe8fc 70%);
  opacity: .75;
}
.bg__circle--tl { width: 60vw; height: 60vw; max-width: 380px; max-height: 380px; top: -14vw; left: -18vw; }
.bg__circle--sm { display: none; }

.bg__dots {
  position: absolute;
  top: 14%;
  right: 4%;
  width: 170px;
  height: 150px;
  background-image: radial-gradient(#c7d6ee 1.6px, transparent 1.7px);
  background-size: 26px 26px;
  opacity: .8;
  display: none;
}

/* ---------- Page layout ---------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px 16px;
}

.brand {
  text-align: center;
  margin-bottom: 12px;
}
.brand__logo {
  width: clamp(170px, 44vw, 230px);
  height: auto;
  margin: 0 auto;
}
.brand__tagline {
  margin: 2px 0 0;
  font-size: clamp(.88rem, .85rem + .15vw, 1rem);
  color: #1e2a4a;
  letter-spacing: .01em;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 410px;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow:
    0 1px 2px rgba(16, 42, 92, .05),
    0 18px 50px rgba(30, 80, 170, .12);
  padding: 24px 24px 20px;
}

.prototype-note {
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px dashed #e0a100;
  border-radius: 8px;
  background: #fff8e6;
  color: #6b4a00;
  font-size: .85rem;
  text-align: center;
}

.card__title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.65rem, 1.5rem + .5vw, 1.9rem);
  line-height: 1.15;
  font-weight: 700;
  color: var(--navy);
}
.card__subtitle {
  margin: 6px 0 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

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

.form__alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #f5c2bd;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: .875rem;
}
.form__alert[data-tone="info"] {
  border-color: #c7d9f7;
  background: #eef4ff;
  color: #173f82;
}

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

.control {
  display: flex;
  align-items: stretch;
  min-height: var(--control-h);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--input-bg);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.control:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(11, 95, 227, .25);
}

.control__icon {
  flex: 0 0 var(--icon-w);
  display: grid;
  place-items: center;
  background: var(--blue-600);
  color: #fff;
}
.control__icon--muted { background: var(--muted-icon); }
.control__icon svg { width: 21px; height: 21px; }

.control__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;   /* ≥16px prevents iOS zoom-on-focus */
  color: var(--text);
}
.control__input::placeholder { color: var(--placeholder); opacity: 1; }
.control__input:focus { outline: none; } /* focus shown on .control via :focus-within */

.control__toggle {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: #5b6475;
  cursor: pointer;
}
.control__toggle:hover { color: var(--blue-600); }
.control__toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}
.control__toggle .icon-eye { display: none; }
.control__toggle[aria-pressed="true"] .icon-eye { display: block; }
.control__toggle[aria-pressed="true"] .icon-eye-off { display: none; }

.field__error {
  margin: 0;
  color: var(--danger);
  font-size: .9rem;
}
.field--invalid .control { border-color: var(--danger); }
.field--invalid .control:focus-within { box-shadow: 0 0 0 3px rgba(180, 35, 24, .2); }

/* ---------- CAPTCHA ---------- */
.captcha {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
}
.captcha__question {
  margin: 0;
  min-width: 150px;
  min-height: var(--control-h);
  padding: 4px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e3e8f0;
  border-radius: var(--radius-control);
  background: #f7f9fc;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #111827;
  user-select: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.captcha__question[aria-busy="true"] { opacity: .55; }

.captcha__refresh {
  flex: 0 0 var(--control-h);
  width: var(--control-h);
  min-height: var(--control-h);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-control);
  background: #e8f0fd;
  color: var(--blue-600);
  cursor: pointer;
  transition: background-color .15s ease;
}
.captcha__refresh:hover { background: #d8e6fc; }
.captcha__refresh:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.captcha__refresh svg { transition: transform .45s ease; }
.captcha__refresh.is-spinning svg { transform: rotate(360deg); }

/* ---------- Primary button ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--blue-600);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn-primary:disabled { opacity: .7; cursor: progress; }

/* ---------- Links & divider ---------- */
.card a {
  color: var(--blue-link);
  text-decoration: none;
  font-weight: 500;
  border-radius: 3px;
}
.card a:hover { text-decoration: underline; }
.card a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.card__forgot {
  margin: 12px 0 0;
  text-align: center;
}
.card__forgot a { display: inline-block; padding: 6px 4px; } /* larger touch target */

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0;
  color: #6b7280;
  font-size: .875rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #dfe3ea;
}

.card__register {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
}
.card__register a { display: inline-block; padding: 6px 4px; margin-left: 4px; }

/* ---------- Very narrow screens (≤ 359px) ---------- */
@media (max-width: 359px) {
  :root { --icon-w: 42px; }
  .page { padding: 16px 12px; }
  .card { padding: 22px 16px 18px; }
  .captcha { gap: 8px; }
  .captcha__question { min-width: 0; flex: 1 1 auto; padding: 4px 12px; font-size: 1.6rem; }
}

/* ---------- Tablet and up ---------- */
@media (min-width: 600px) {
  :root { --control-h: 46px; --icon-w: 46px; }
  .card { padding: 26px 28px 22px; }
  .card__subtitle { margin-bottom: 18px; }
  .form { gap: 12px; }
  .bg__circle--sm {
    display: block;
    width: 100px; height: 100px;
    top: 37%; left: 11%;
  }
  .bg__dots { display: block; }
  .bg__waves { width: 55vw; height: 75vh; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  :root { --control-h: 46px; --icon-w: 46px; }
  .card { padding: 26px 28px 22px; }
  .bg__waves { width: 42vw; height: 80vh; }
  .btn-primary { min-height: 46px; }
  .captcha__question { min-width: 192px; font-size: 2.1rem; }
}

/* Short landscape screens: let the page scroll naturally */
@media (max-height: 700px) and (min-width: 600px) {
  .page { justify-content: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Windows high-contrast / forced colours ---------- */
@media (forced-colors: active) {
  .control:focus-within,
  .btn-primary:focus-visible { outline: 2px solid CanvasText; }
  .control__icon { forced-color-adjust: auto; }
}

/* Laravel messages and image CAPTCHA */
[hidden] { display: none !important; }
.brand a { display: inline-block; border-radius: 6px; }
.brand a:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.card { min-width: 0; }
.card > .form__alert { margin-bottom: 12px; }
.form__alert { overflow-wrap: anywhere; text-align: left; }
.form__alert ul { margin: 0; padding-left: 18px; }
.form__alert--success { border-color: #b9e3ce; background: #edfaf3; color: #176442; }
.captcha { align-items: center; gap: 10px; min-width: 0; }
.captcha__image { display: block; width: auto; height: auto; max-height: 44px; max-width: calc(100% - 54px); border-radius: 7px; }
.captcha__refresh { flex: 0 0 44px; width: 44px; min-height: 44px; }
.field__error { font-size: .8rem; overflow-wrap: anywhere; }
.control:has([aria-invalid="true"]) { border-color: var(--danger); }
.card__forgot, .card__register { font-size: .875rem; }
.card__forgot a, .card__register a { min-height: 44px; padding: 11px 4px; }
.btn-primary svg { width: 21px; height: 21px; }
button:disabled { opacity: .65; cursor: progress; }
@media (max-width: 480px) {
  .card { padding: 22px 20px 18px; }
  .bg__waves { height: 55vh; width: 90vw; opacity: .75; }
}
@media (max-width: 359px) {
  .card { padding: 20px 16px 16px; }
  .control__input { padding: 0 10px; }
}
@media (max-height: 640px) {
  .page { justify-content: flex-start; padding-top: 14px; padding-bottom: 14px; }
  .brand { margin-bottom: 10px; }
  .brand__logo { width: 170px; }
  .brand__tagline { font-size: .85rem; }
}
