:root {
  color-scheme: light;
  --easy-bg: #eef2f7;
  --easy-surface: #ffffff;
  --easy-surface-soft: #f8fafc;
  --easy-text: #0f172a;
  --easy-muted: #64748b;
  --easy-border: #dbe3ee;
  --easy-primary: #1d4ed8;
  --easy-primary-hover: #1e40af;
  --easy-focus: rgba(37,99,235,.18);
  --easy-overlay-a: rgba(5,20,48,.78);
  --easy-overlay-b: rgba(15,23,42,.42);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --easy-bg: #07111f;
  --easy-surface: #0d1828;
  --easy-surface-soft: #0b1524;
  --easy-text: #f8fafc;
  --easy-muted: #a7b4c7;
  --easy-border: #2b3a50;
  --easy-primary: #3b82f6;
  --easy-primary-hover: #60a5fa;
  --easy-focus: rgba(96,165,250,.22);
  --easy-overlay-a: rgba(2,8,23,.85);
  --easy-overlay-b: rgba(2,6,23,.58);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body.easy-login {
  overflow: hidden;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--easy-text);
  background: var(--easy-bg);
}

a { color: var(--easy-primary); text-decoration: none; }
a:hover, a:focus { color: var(--easy-primary-hover); text-decoration: underline; }

.easy-login-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  overflow: hidden;
}

.easy-login-visual {
  position: relative;
  min-width: 0;
  height: 100%;
  background-image:
    linear-gradient(135deg, var(--easy-overlay-a), var(--easy-overlay-b)),
    url("../../img/logo/login-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 4.5vw, 64px);
  isolation: isolate;
}
.easy-login-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(to top, rgba(2,6,23,.35), transparent);
  z-index: -1;
}
.easy-visual-content { max-width: 610px; color: #fff; }
.easy-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.easy-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74,222,128,.14);
}
.easy-visual-content h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.03;
  letter-spacing: -.04em;
  font-weight: 800;
}
.easy-visual-content p {
  margin: 0;
  max-width: 540px;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.5;
  color: rgba(255,255,255,.84);
}

.easy-login-panel {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px clamp(24px, 3.6vw, 52px) 18px;
  background: var(--easy-surface-soft);
  overflow: hidden;
}
.easy-theme-switcher {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--easy-border);
  border-radius: 10px;
  background: var(--easy-surface);
}
.easy-theme-btn {
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  background: transparent;
  color: var(--easy-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.easy-theme-btn:hover { color: var(--easy-text); background: rgba(148,163,184,.12); }
.easy-theme-btn.is-active { color: #fff; background: var(--easy-primary); }

.easy-login-card { width: 100%; max-width: 410px; }
.easy-brand { display: block; margin-bottom: 16px; }
.easy-brand img {
  display: block;
  max-width: min(100%, 280px);
  width: auto;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}
.easy-login-title { margin: 0 0 5px; font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.easy-login-subtitle { margin: 0 0 15px; color: var(--easy-muted); font-size: 14px; line-height: 1.45; }

.easy-form-group { margin-bottom: 10px; }
.easy-form-label { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--easy-text); }
.easy-field-wrap { position: relative; }
.easy-login .easy-input,
.easy-login input[type="text"],
.easy-login input[type="password"],
.easy-login select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--easy-border);
  border-radius: 10px;
  background: var(--easy-surface);
  color: var(--easy-text);
  padding: 0 13px;
  outline: 0;
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.easy-login input[type="password"],
.easy-login input[name="pass"] { padding-right: 48px !important; }
.easy-login .easy-input:focus,
.easy-login input[type="text"]:focus,
.easy-login input[type="password"]:focus,
.easy-login select:focus {
  border-color: var(--easy-primary);
  box-shadow: 0 0 0 3px var(--easy-focus);
}

.easy-password-toggle {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--easy-muted);
  cursor: pointer;
  z-index: 5;
  appearance: none;
  -webkit-appearance: none;
}
.easy-password-toggle:hover,
.easy-password-toggle:focus { background: rgba(148,163,184,.13); color: var(--easy-text); outline: 0; }
.easy-eye {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.easy-eye-hide { display: none; }
.easy-password-toggle.is-visible .easy-eye-show { display: none; }
.easy-password-toggle.is-visible .easy-eye-hide { display: block; }

.easy-submit { margin-top: 12px; }
.easy-submit .btn {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}
.easy-submit .btn-primary { background-color: var(--easy-primary); border-color: var(--easy-primary); }
.easy-submit .btn-primary:hover,
.easy-submit .btn-primary:focus { background-color: var(--easy-primary-hover); border-color: var(--easy-primary-hover); }

.easy-links-row {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
}
.easy-extra-links { display: flex; flex-wrap: wrap; gap: 7px 14px; font-size: 12.5px; }
.easy-remember { color: var(--easy-muted); font-size: 12.5px; }
.easy-login-footer { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--easy-border); color: var(--easy-muted); font-size: 11.5px; }

.easy-login #id_sc_field_language { width: 100%; }
.easy-login #id_sc_field_language select { width: 100% !important; }
.easy-login #id-new_user-1,
.easy-login #id-retrieve_pswd-1 { display: inline-block; }
.easy-login #id_sc_field_remember_me_1 { vertical-align: middle; }
.easy-login span.sc-ui-pwd-toggle-icon { display: none !important; }

.alert-message {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 9999;
  transform: translate(-50%, -160%);
  width: min(92vw, 500px);
  padding: 11px 40px 11px 14px;
  border-radius: 10px;
  text-align: center;
  color: #fff;
  font-size: 12.5px;
  transition: transform .2s ease;
  box-shadow: 0 12px 34px rgba(15,23,42,.25);
}
.alert-message.active { transform: translate(-50%, 0); }
.alert-message.negative { background: #dc2626; }
.alert-message.positive { background: #16a34a; }
.alert-message.warning { background: #d97706; }
.alert-message.primary { background: #2563eb; }
.alert-message .close { position: absolute; right: 11px; top: 5px; cursor: pointer; font-size: 22px; opacity: .75; }
.alert-message .close:hover { opacity: 1; }

/* Telas de desktop com pouca altura: compacta sem criar scrollbar. */
@media (min-width: 981px) and (max-height: 760px) {
  .easy-login-panel { padding-top: 52px; padding-bottom: 16px; }
  .easy-brand { margin-bottom: 14px; }
  .easy-brand img { max-height: 48px; }
  .easy-login-title { font-size: 24px; }
  .easy-login-subtitle { margin-bottom: 10px; }
  .easy-form-group { margin-bottom: 9px; }
  .easy-login .easy-input,
  .easy-login input[type="text"],
  .easy-login input[type="password"],
  .easy-login select { height: 40px; }
  .easy-submit { margin-top: 12px; }
  .easy-submit .btn { min-height: 40px; }
  .easy-links-row { margin-top: 9px; }
  .easy-login-footer { margin-top: 12px; padding-top: 9px; }
}

@media (max-width: 980px) {
  html, body { height: auto; min-height: 100%; }
  body.easy-login { overflow-y: auto; }
  .easy-login-shell { height: auto; min-height: 100vh; display: block; overflow: visible; }
  .easy-login-visual { height: 30vh; min-height: 230px; align-items: center; padding: 28px; }
  .easy-visual-content h1 { font-size: clamp(32px, 7vw, 48px); }
  .easy-login-panel { height: auto; min-height: 70vh; padding: 68px 24px 28px; overflow: visible; }
}

@media (max-width: 560px) {
  .easy-login-visual { display: none; }
  .easy-login-panel { min-height: 100vh; padding: 68px 18px 26px; }
  .easy-theme-switcher { top: 14px; right: 14px; }
  .easy-theme-btn { padding: 6px 8px; }
  .easy-brand { margin-bottom: 18px; }
  .easy-brand img { max-height: 52px; }
  .easy-login-title { font-size: 25px; }
}
