/* Login page (application/views/layout/login.php) */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins/poppins-v5-latin-regular.woff2") format("woff2"),
       url("../fonts/poppins/poppins-v5-latin-regular.woff") format("woff");
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins/poppins-v5-latin-500.woff2") format("woff2"),
       url("../fonts/poppins/poppins-v5-latin-500.woff") format("woff");
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins/poppins-v5-latin-600.woff2") format("woff2"),
       url("../fonts/poppins/poppins-v5-latin-600.woff") format("woff");
}

:root {
  --brand: #1d5bb5;
  --brand-dark: #133f82;
  --brand-deep: #0b2a5b;
  --accent: #2f9e44;
  --ink: #16213a;
  --muted: #64708a;
  --line: #d9dfea;
  --field: #f6f8fb;
  --page: #eef2f8;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

.auth {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Brand panel */

.auth-brand {
  position: relative;
  flex: 0 0 44%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .14), transparent 45%),
    radial-gradient(circle at 90% 95%, rgba(47, 158, 68, .35), transparent 50%),
    linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 55%, var(--brand-deep) 100%);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
}

.auth-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}

.auth-brand-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7fd88f;
  box-shadow: 0 0 0 4px rgba(127, 216, 143, .25);
}

.auth-brand h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.auth-brand p {
  margin: 0;
  max-width: 420px;
  font-size: 15px;
  color: rgba(255, 255, 255, .78);
}

.auth-brand-foot {
  font-size: 13px;
  color: rgba(255, 255, 255, .6);
}

/* Form panel */

.auth-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: #fff;
  border: 1px solid #e3e8f1;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 33, 70, .04), 0 12px 32px -12px rgba(16, 33, 70, .18);
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 0 28px;
}

.auth-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f5c6c0;
  border-radius: 10px;
}

.auth-alert .zmdi {
  font-size: 18px;
  line-height: 1.2;
}

.field {
  margin: 0 0 18px;
}

.field label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: #39445c;
}

.field-control {
  position: relative;
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: 18px;
  color: #8a95ab;
  pointer-events: none;
  transition: color .15s ease;
}

.field input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.field input::placeholder {
  color: #a3acbe;
}

.field input:hover {
  border-color: #bcc6d8;
}

.field input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(29, 91, 181, .15);
}

.field-control:focus-within .field-icon {
  color: var(--brand);
}

.field-password input {
  padding-right: 48px;
}

/* Hide the browser's own reveal button so only ours shows */
.field-password input::-ms-reveal,
.field-password input::-ms-clear {
  display: none;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 19px;
  color: #8a95ab;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

.password-toggle-btn:hover {
  color: var(--ink);
  background: #e9edf4;
}

.password-toggle-btn:focus {
  outline: none;
}

.password-toggle-btn:focus-visible {
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 91, 181, .25);
}

.auth-submit {
  position: relative;
  margin-top: 26px;
}

.auth-submit input {
  display: block;
  width: 100%;
  height: 48px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 6px 16px -6px rgba(29, 91, 181, .55);
  transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.auth-submit input:hover {
  background: var(--brand-dark);
}

.auth-submit input:active {
  transform: translateY(1px);
}

.auth-submit input:focus {
  outline: none;
}

.auth-submit input:focus-visible {
  box-shadow: 0 0 0 4px rgba(29, 91, 181, .3);
}

/* Shown after submit while the next page loads */
.auth-submit.is-loading input {
  color: transparent;
  cursor: progress;
  background: var(--brand-dark);
}

.auth-submit.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
  pointer-events: none;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-copy {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Tablet and phone: single column, brand panel hidden */

@media (max-width: 900px) {
  .auth-brand {
    display: none;
  }

  .auth-main {
    padding: 32px 16px;
    background:
      radial-gradient(circle at 0% 0%, rgba(29, 91, 181, .12), transparent 40%),
      radial-gradient(circle at 100% 100%, rgba(47, 158, 68, .1), transparent 40%),
      var(--page);
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 14px;
  }

  .auth-logo {
    max-width: 220px;
    margin-bottom: 22px;
  }

  .auth-title {
    font-size: 21px;
  }

  /* 16px stops iOS zooming into the field on focus */
  .field input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 1.5s !important;
  }
}
