/* ==========================================================================
   Sign-in page — modern split layout
   Load after style.css:  <link rel="stylesheet" href="<?= $this->asset('css/login.css') ?>">
   ========================================================================== */

html body.page-auth.page-login {
  --lo-ink: #0b1f3a;
  --lo-text: #41536d;
  --lo-line: #ccd9e8;
}

/* ---------- Shell ---------- */
html body.page-auth.page-login .login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  flex: 1;
  width: min(100% - (var(--gutter) * 2), 1120px);
  min-height: 660px;
  margin: clamp(56px, 8vw, 112px) auto clamp(72px, 10vw, 136px);
  overflow: hidden;
  border: 1px solid #d5e1f0;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 40px 90px -40px rgba(16, 42, 86, .45);
}

/* ---------- Brand panel ---------- */
html body.page-auth.page-login .login-left {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: clamp(36px, 5vw, 64px);
  background: linear-gradient(145deg, var(--brand-blue-deep) 0%, var(--brand-blue) 70%, #2467b5 100%);
  overflow: hidden;
}
.page-login .login-left::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 60% at 100% 0%, rgba(114, 199, 255, .35), transparent 65%),
    radial-gradient(45% 50% at 0% 100%, rgba(31, 111, 235, .5), transparent 70%);
}
.page-login .login-left::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(80% 80% at 80% 10%, #000, transparent 75%);
          mask-image: radial-gradient(80% 80% at 80% 10%, #000, transparent 75%);
}
html body.page-auth.page-login .hero-heading {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: -.035em;
}
html body.page-auth.page-login .login-left .hero-heading span {
  background: linear-gradient(95deg, #72c7ff, #d6eeff);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
html body.page-auth.page-login .login-left .hero-sub {
  max-width: 46ch; margin: 0;
  color: #c6d7ef; font-size: 16px; line-height: 1.7;
}

html body.page-auth.page-login .feature-list {
  display: grid; gap: 14px;
  margin: 34px 0 0; padding: 0; list-style: none;
}
html body.page-auth.page-login .feature-item {
  display: flex; align-items: flex-start; gap: 12px;
}
html body.page-auth.page-login .login-left .feature-item > span:last-child {
  color: #e3eefc; font-size: 15px; line-height: 1.5;
}
html body.page-auth.page-login .feature-dot {
  display: grid; place-items: center; flex: 0 0 26px;
  width: 26px; height: 26px; margin-top: 1px;
  border-radius: 8px;
  background: rgba(114, 199, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(114, 199, 255, .35);
  color: #72c7ff;
}
.page-login .feature-dot svg { width: 14px; height: 14px; }

/* decorative status sample */
.page-login .login-preview {
  display: grid; gap: 8px;
  max-width: 400px; margin-top: 40px; padding: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.page-login .login-preview-row {
  padding: 10px 12px 11px; border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  color: #fff; font-size: 13px;
}
.page-login .login-preview-main { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.page-login .login-preview-row b { font-weight: 600; }
.page-login .login-preview-row span {
  margin-left: auto; color: #b9d3f1;
  font-family: var(--font-mono); font-size: 12px;
}
.page-login .login-preview-row i {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: #3ddc97; box-shadow: 0 0 10px #3ddc97;
}
.page-login .login-preview-row i.is-down { background: #ff6b63; box-shadow: 0 0 10px #ff6b63; }
.page-login .login-preview-row.is-down { background: rgba(255, 107, 99, .16); }
.page-login .login-preview-row.is-down span { color: #ffb3ae; }

/* ---------- Form panel ---------- */
html body.page-auth.page-login .login-right {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(32px, 5vw, 64px);
  border-left: 0;
  background: #fff;
}
html body.page-auth.page-login .login-card { width: 100%; max-width: 380px; }
html body.page-auth.page-login .login-card h2 {
  margin: 0 0 8px; color: var(--lo-ink);
  font-size: 28px; font-weight: 760; letter-spacing: -.03em; line-height: 1.15;
}
html body.page-auth.page-login .login-card > .login-intro {
  margin: 0 0 24px; color: var(--site-muted); font-size: 15px; line-height: 1.6;
}

html body.page-auth.page-login .google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 50px; padding: 12px 20px;
  border: 1px solid var(--lo-line); border-radius: 12px;
  background: #fff; color: var(--lo-ink);
  font-size: 15px; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 2px rgba(14, 26, 46, .05);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
html body.page-auth.page-login .google-btn:hover {
  border-color: var(--site-accent); background: #fff;
  box-shadow: 0 10px 24px -14px rgba(31, 111, 235, .5); transform: translateY(-1px);
}

html body.page-auth.page-login .divider {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0; color: #718198; font-size: 12px; font-weight: 600;
}
.page-login .divider::before,
.page-login .divider::after { content: ""; flex: 1; height: 1px; background: #e1e9f3; }

/* Tabs: segmented control */
html body.page-auth.page-login .auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 0 0 22px; padding: 4px;
  border: 0; border-radius: 12px; background: #eef3f9;
}
html body.page-auth.page-login .auth-tab {
  width: 100%; min-height: 40px; margin: 0; padding: 8px 12px;
  border: 0; border-radius: 9px; background: transparent;
  color: #5f6f86; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
html body.page-auth.page-login .auth-tab:hover { background: rgba(255, 255, 255, .6); color: var(--lo-ink); }
html body.page-auth.page-login .auth-tab.active {
  background: #fff; color: var(--site-accent);
  box-shadow: 0 2px 8px rgba(14, 26, 46, .12);
}
html body.page-auth.page-login .auth-tab:focus-visible { outline: 3px solid rgba(31, 111, 235, .4); outline-offset: 2px; }

/* Fields */
html body.page-auth.page-login .auth-field { min-width: 0; margin: 0 0 16px; }
html body.page-auth.page-login .auth-field > label {
  display: block; margin: 0 0 6px;
  color: #41536d; font-size: 13px; font-weight: 600;
}
html body.page-auth.page-login .auth-field input[type=text],
html body.page-auth.page-login .auth-field input[type=email],
html body.page-auth.page-login .auth-field input[type=password] {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--lo-line); border-radius: 12px;
  background: #f8fbff; color: var(--lo-ink);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
html body.page-auth.page-login .auth-field input:hover { border-color: #aebfd8; }
html body.page-auth.page-login .auth-field input:focus {
  border-color: var(--site-accent); background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, .14);
}
.page-login .auth-hint { display: block; margin-top: 6px; color: #718198; font-size: 12px; }

html body.page-auth.page-login .auth-login-options {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 2px 0 20px;
}
html body.page-auth.page-login .remember-option {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  color: #5f6f86; font-size: 13px; font-weight: 500; cursor: pointer;
}
html body.page-auth.page-login .remember-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--site-accent); }
html body.page-auth.page-login .auth-login-options > a {
  color: var(--site-accent); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.page-login .auth-login-options > a:hover { text-decoration: underline; text-underline-offset: 3px; }

html body.page-auth.page-login .auth-submit {
  width: 100%; min-height: 50px; margin: 0; padding: 12px;
  border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #3b86f5, var(--site-accent));
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 26px -10px rgba(31, 111, 235, .7);
  transition: transform .15s, box-shadow .15s;
}
html body.page-auth.page-login .auth-submit:hover {
  background: linear-gradient(180deg, #4b92ff, var(--site-accent-hover));
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 16px 30px -10px rgba(31, 111, 235, .8);
}
html body.page-auth.page-login .auth-submit:focus-visible,
html body.page-auth.page-login .google-btn:focus-visible { outline: 3px solid rgba(31, 111, 235, .4); outline-offset: 3px; }

/* Messages */
html body.page-auth.page-login .auth-message {
  margin: 0 0 18px; padding: 11px 14px;
  border: 1px solid; border-radius: 12px; font-size: 13px; line-height: 1.55;
}
html body.page-auth.page-login .auth-message.error { border-color: rgba(214, 69, 69, .3); background: rgba(214, 69, 69, .07); color: #b83232; }
html body.page-auth.page-login .auth-message.success { border-color: rgba(31, 157, 85, .3); background: rgba(31, 157, 85, .08); color: #18794a; }

html body.page-auth.page-login .disclaimer {
  margin: 24px 0 0; color: #718198; font-size: 12px; line-height: 1.7; text-align: center; text-wrap: balance;
}
html body.page-auth.page-login .disclaimer a { color: var(--site-accent); font-weight: 600; text-decoration: none; }
.page-login .disclaimer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  html body.page-auth.page-login .login-grid {
    grid-template-columns: 1fr; min-height: 0; margin: 40px auto 64px; border-radius: 22px;
  }
  html body.page-auth.page-login .login-left { display: none; }
  html body.page-auth.page-login .login-right {
    min-height: 0; padding: 36px 24px 40px; border-top: 4px solid var(--site-accent);
  }
}
@media (max-width: 480px) {
  html body.page-auth.page-login .login-grid { width: calc(100% - 24px); margin: 28px auto 48px; }
  html body.page-auth.page-login .login-right { padding: 28px 18px 32px; }
  html body.page-auth.page-login .auth-login-options { align-items: flex-start; flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html body.page-auth.page-login :is(.google-btn, .auth-submit, .auth-tab) { transition: none; }
  html body.page-auth.page-login :is(.google-btn, .auth-submit):hover { transform: none; }
}

/* ---------- Extras ---------- */
.page-login .login-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 4px; color: #fff; font-size: 13px;
}
.page-login .login-preview-head span { display: inline-flex; align-items: center; gap: 7px; color: #7ff0b8; font-size: 12px; font-weight: 600; }
.page-login .login-live { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; }
.page-login .login-live::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid #3ddc97; opacity: 0; animation: lo-ping 2.2s ease-out infinite;
}
@keyframes lo-ping { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.page-login .login-strip { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; height: 16px; }
.page-login .login-strip u {
  border-radius: 2px; background: #3ddc97; opacity: .85; text-decoration: none; transform-origin: bottom;
  animation: lo-rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 20ms + 300ms);
}
.page-login .login-strip u.is-down { background: #ff6b63; opacity: 1; }
@keyframes lo-rise { from { transform: scaleY(.15); opacity: 0; } to { transform: scaleY(1); } }

/* password strength meter */
.page-login .pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.page-login .pw-meter i { height: 4px; border-radius: 999px; background: #e1e9f3; transition: background-color .2s; }
.page-login .pw-meter[data-level="1"] i:nth-child(-n+1) { background: #d64545; }
.page-login .pw-meter[data-level="2"] i:nth-child(-n+2) { background: #e0a020; }
.page-login .pw-meter[data-level="3"] i:nth-child(-n+3) { background: #5cb85c; }
.page-login .pw-meter[data-level="4"] i { background: #1f9d55; }
.page-login .pw-meter + .auth-hint { margin-top: 6px; }

/* caps lock note */
.page-login .auth-caps { color: #b7791f; font-weight: 600; }
.page-login .auth-caps[hidden] { display: none; }

/* submit loading state */
html body.page-auth.page-login .auth-submit.is-loading { position: relative; opacity: .85; cursor: progress; }
.page-login .auth-submit.is-loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
  animation: lo-spin .7s linear infinite;
}
@keyframes lo-spin { to { transform: rotate(360deg); } }

/* tab panel entrance (answers a user action) */
.page-login #form-login:not([hidden]),
.page-login #form-register:not([hidden]) { animation: lo-fade .25s ease-out; }
@keyframes lo-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .page-login .login-live::after, .page-login .login-strip u,
  .page-login #form-login, .page-login #form-register,
  .page-login .auth-submit.is-loading::before { animation: none; }
}