/* ==========================================================================
   H2O Admin — Authentication screen
   --------------------------------------------------------------------------
   Self-contained: the login view does NOT use AdminLTE's .login-page /
   .login-box classes, so nothing here fights adminlte.min.css and nothing
   here can leak into the rest of the application.

   Layout: one centred card, split into a brand panel (left) and the sign-in
   form (right). Below 860px the card stacks and the brand panel collapses
   into a compact band above the form.
   ========================================================================== */

:root {
  --auth-primary:      #e88421;
  --auth-primary-lt:   #f59a35;
  --auth-primary-dark: #cf6f11;

  --auth-navy:         #15304a;
  --auth-navy-lt:      #1d4468;
  --auth-navy-deep:    #0b1c2c;

  --auth-surface:      #ffffff;
  --auth-field:        #fbfcfe;

  --auth-text:         #23303f;
  --auth-text-soft:    #5b6b7d;
  --auth-text-muted:   #8a97a6;

  --auth-border:       #e4e9f0;
  --auth-danger:       #d92d20;
  --auth-success:      #1f9254;

  --auth-radius-card:  24px;
  --auth-radius:       12px;

  --auth-font: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }

html.auth-html { height: 100%; }

body.auth-body {
  margin: 0;
  min-height: 100vh;
  /* dvh tracks the mobile address bar, so the card is never pushed out of the
     visible viewport. Ignored by browsers without dvh — they keep the vh line. */
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--auth-font);
  font-size: .875rem;
  line-height: 1.5;
  color: var(--auth-text);
  -webkit-font-smoothing: antialiased;
  /* Two soft brand-tinted washes over a cool neutral base: warm orange from the
     top-left, navy from the bottom-right. */
  background:
    radial-gradient(1100px 500px at 15% -10%, #fdeacf 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 120%, #dde7f2 0%, transparent 50%),
    linear-gradient(120deg, #f7f9fc 0%, #eaeff6 100%);
}


/* ==========================================================================
   Card
   ========================================================================== */
.login-card {
  display: flex;
  width: min(940px, 100%);
  min-height: 520px;
  background: var(--auth-surface);
  border-radius: var(--auth-radius-card);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(21, 48, 74, .18),
              0 6px 20px rgba(16, 24, 40, .06);
}


/* ==========================================================================
   Brand panel
   ========================================================================== */
.login-brand {
  position: relative;
  flex: 1 1 44%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 46px 38px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(150deg, var(--auth-navy-lt) 0%, var(--auth-navy) 55%, var(--auth-navy-deep) 100%);
}

/* Two out-of-frame glows: warm from the top-right, a cool highlight bottom-left.
   Decorative only, so they are pulled out of the pointer and a11y trees. */
.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-brand::before {
  width: 320px;
  height: 320px;
  top: -90px;
  right: -120px;
  background: radial-gradient(circle, rgba(232, 132, 33, .45) 0%, transparent 70%);
}

.login-brand::after {
  width: 260px;
  height: 260px;
  bottom: -90px;
  left: -110px;
  background: radial-gradient(circle, rgba(255, 255, 255, .14) 0%, transparent 70%);
}

.brand-top {
  position: relative;
  z-index: 1;
  text-align: center;
}

/* White chip behind the mark: logo.png is a transparent PNG in mid-tone brand
   colours, which would sink into the navy panel on its own. */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  margin: 0 auto 18px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .25);
}

.brand-logo img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 74px;
}

.brand-title {
  max-width: 280px;
  margin: 8px auto 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .2px;
}

.brand-sub {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #f4c98a;
}

.brand-mantra {
  position: relative;
  z-index: 1;
  padding-top: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #ffd9a6;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

.brand-mantra small {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .3px;
  color: rgba(255, 255, 255, .6);
}


/* ==========================================================================
   Form panel
   ========================================================================== */
.login-form {
  flex: 1 1 56%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 46px;
}

.login-form h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  color: var(--auth-navy);
}

.login-form .lead {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--auth-text-muted);
}

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: auth-wave 1.8s ease-in-out infinite;
}

@keyframes auth-wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

/* Respect a reduced-motion preference — the wave is pure decoration. */
@media (prefers-reduced-motion: reduce) {
  .wave { animation: none; }
}


/* --- Fields --------------------------------------------------------------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #5a6b7c;
}

.field-wrap { position: relative; }

.field-wrap > .lead-ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #a9b6c4;
  pointer-events: none;
}

.field-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 44px;
  font-family: inherit;
  font-size: 15px;
  color: var(--auth-text);
  background: var(--auth-field);
  border: 1.6px solid var(--auth-border);
  border-radius: var(--auth-radius);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

/* No trailing button on this field, so the text may run to the edge. */
.field-wrap:not(.has-toggle) input { padding-right: 16px; }

.field-wrap input::placeholder { color: #b3bfcb; }

.field-wrap input:focus {
  outline: none;
  background: #fff;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(232, 132, 33, .13);
}

.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 16px;
  color: #9aa8b6;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.eye-btn:hover,
.eye-btn:focus-visible {
  color: var(--auth-primary);
  background: rgba(232, 132, 33, .1);
  outline: none;
}

/* Caps Lock warning — a common cause of "wrong password" on this screen.
   Held out of the layout until the JS turns it on. */
.field-hint {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #b95000;
}

.field-hint.is-visible { display: flex; }


/* --- Remember / submit ---------------------------------------------------- */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--auth-text-soft);
  cursor: pointer;
  user-select: none;
}

.remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--auth-primary);
  cursor: pointer;
}

.auth-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-primary);
  text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-primary-lt) 0%, var(--auth-primary) 60%, var(--auth-primary-dark) 100%);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(232, 132, 33, .36);
  transition: transform .14s ease, box-shadow .2s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(232, 132, 33, .46);
}

.btn-login:active { transform: translateY(0); }

.btn-login:focus-visible {
  outline: none;
  box-shadow: 0 10px 24px rgba(232, 132, 33, .36), 0 0 0 4px rgba(21, 48, 74, .25);
}

.login-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--auth-text-muted);
}

.login-foot strong { color: var(--auth-text-soft); }


/* --- Alerts --------------------------------------------------------------- */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 600;
  border: 0;
  border-radius: var(--auth-radius);
}

.auth-alert i { font-size: 15px; }

.auth-alert--danger  { color: #c53350; background: #fdeaec; }
.auth-alert--success { color: var(--auth-success); background: #e8f7ee; }


/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  body.auth-body { padding: 16px; }

  .login-card {
    flex-direction: column;
    min-height: 0;
  }

  /* The brand panel becomes a band: logo and name side by side, so the form
     stays above the fold on a phone. */
  .login-brand {
    flex: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 26px 24px;
  }

  .brand-top {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
  }

  .brand-logo { margin: 0; padding: 9px 13px; border-radius: 14px; }
  .brand-logo img { max-height: 40px; }
  .brand-title { margin: 0; font-size: 18px; }
  .brand-sub { margin-top: 4px; letter-spacing: 2px; }
  .brand-mantra { display: none; }

  .login-form { padding: 32px 26px; }
}

@media (max-width: 480px) {
  body.auth-body { padding: 0; }

  .login-card {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .login-form {
    flex: 1 1 auto;
    padding: 28px 20px 32px;
  }

  .login-form h1 { font-size: 21px; }

  /* 16px keeps iOS Safari from zooming the viewport when a field is focused. */
  .field-wrap input { font-size: 16px; }
}
