/* ==========================================================================
   RIL Pre-Verification — sign-in screen
   --------------------------------------------------------------------------
   Split layout: the photography carries the left side, the form sits on a
   plain white panel on the right where contrast is guaranteed. Shares the
   palette with assets/css/ril-design-system.css.
   ========================================================================== */

:root {
  --ril-accent:        #0c6fa0;
  --ril-accent-hover:  #08567c;
  --ril-accent-light:  #2298c9;
  --ril-accent-wash:   #eaf4fa;

  --ril-canvas:        #f5f7f9;
  --ril-surface:       #ffffff;
  --ril-surface-alt:   #fafbfc;
  --ril-border:        #e3e8ec;
  --ril-border-strong: #ccd4db;

  --ril-text:          #151b28;
  --ril-text-muted:    #6b7280;
  --ril-text-faint:    #9aa1ac;

  --ril-success:       #157347;
  --ril-success-wash:  #e8f5ee;
  --ril-warning:       #b45309;
  --ril-warning-wash:  #fdf3e6;
  --ril-danger:        #b42318;
  --ril-danger-wash:   #fdecea;

  --ril-radius:        8px;
  --ril-radius-sm:     6px;

  --ril-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
              "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body.ril-auth {
  font-family: var(--ril-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ril-text);
  background: var(--ril-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-layout {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   Left — photography
   ========================================================================== */

.auth-visual {
  position: relative;
  flex: 1 1 56%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  color: #fff;
}

.auth-visual .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: ril-fade 24s infinite, ril-zoom 24s infinite;
  opacity: 0;
}

.auth-visual .s2 { animation-delay: 6s; }
.auth-visual .s3 { animation-delay: 12s; }
.auth-visual .s4 { animation-delay: 18s; }

/* Each slide holds ~6s of the 24s cycle with a 1.5s crossfade either side. */
@keyframes ril-fade {
  0%     { opacity: 0; }
  6.25%  { opacity: 1; }
  25%    { opacity: 1; }
  31.25% { opacity: 0; }
  100%   { opacity: 0; }
}

@keyframes ril-zoom {
  0%   { transform: scale(1); }
  100% { transform: scale(1.07); }
}

/* Brand wash: keeps the white copy legible whatever the photo is doing. */
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 48, 70, 0.32) 0%,
    rgba(8, 52, 76, 0.58) 55%,
    rgba(11, 94, 133, 0.86) 100%
  );
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.auth-visual-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 40px;
  margin-bottom: 26px;
  backdrop-filter: blur(4px);
}

.auth-visual h2 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin-bottom: 14px;
}

.auth-visual p {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
}

/* Slide position indicator */
.auth-dots {
  display: flex;
  gap: 7px;
  margin-top: 32px;
}

.auth-dots span {
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .30);
  animation: ril-dot 24s infinite;
}

.auth-dots span:nth-child(2) { animation-delay: 6s; }
.auth-dots span:nth-child(3) { animation-delay: 12s; }
.auth-dots span:nth-child(4) { animation-delay: 18s; }

@keyframes ril-dot {
  0%, 25%   { background: rgba(255, 255, 255, .92); }
  31.25%    { background: rgba(255, 255, 255, .30); }
  100%      { background: rgba(255, 255, 255, .30); }
}

/* ==========================================================================
   Right — form panel
   ========================================================================== */

.auth-panel {
  flex: 0 0 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  background: var(--ril-surface);
}

.auth-form {
  width: 100%;
  max-width: 360px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 36px;
}

.auth-brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--ril-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.auth-brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ril-text);
}

.auth-brand-text span {
  display: block;
  font-size: 12px;
  color: var(--ril-text-muted);
}

.auth-form h1 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.auth-form .auth-lede {
  font-size: 14px;
  color: var(--ril-text-muted);
  margin-bottom: 28px;
}

/* Fields ------------------------------------------------------------------ */

.form-group {
  margin-bottom: 18px;
}

.auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ril-text-muted);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

.input-wrap > i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ril-text-faint);
  font-size: 13px;
  pointer-events: none;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  padding: 11px 42px 11px 38px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ril-text);
  background: var(--ril-surface);
  border: 1px solid var(--ril-border-strong);
  border-radius: var(--ril-radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-form input::placeholder {
  color: var(--ril-text-faint);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--ril-accent);
  box-shadow: 0 0 0 3px rgba(12, 111, 160, .12);
}

.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ril-text-faint);
  font-size: 14px;
  padding: 7px 9px;
  border-radius: var(--ril-radius-sm);
  line-height: 1;
}

.toggle-password:hover {
  color: var(--ril-accent);
  background: var(--ril-accent-wash);
}

.toggle-password:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(12, 111, 160, .12);
}

/* Submit ------------------------------------------------------------------ */

.login-btn {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--ril-accent);
  border: 0;
  border-radius: var(--ril-radius-sm);
  cursor: pointer;
  transition: background-color .15s ease;
}

.login-btn:hover {
  background: var(--ril-accent-hover);
}

.login-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(12, 111, 160, .25);
}

.login-btn:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* Footer ------------------------------------------------------------------ */

.auth-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--ril-border);
  font-size: 12px;
  color: var(--ril-text-muted);
  line-height: 1.7;
}

.auth-footer a {
  color: var(--ril-accent);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-footer .auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--ril-text-faint);
}

.auth-footer .auth-secure i {
  color: var(--ril-success);
}

/* ==========================================================================
   Messages
   Class names are kept as-is because login.php's inline script creates and
   removes these nodes by class.
   ========================================================================== */

.error-container {
  margin-bottom: 18px;
}

.error-message,
.success-message,
.warning-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 10px;
  font-size: 13px;
  border: 1px solid transparent;
  border-radius: var(--ril-radius-sm);
  animation: ril-slide-down .25s ease-out;
}

.error-message {
  background: var(--ril-danger-wash);
  border-color: rgba(180, 35, 24, .25);
  color: var(--ril-danger);
}

.success-message {
  background: var(--ril-success-wash);
  border-color: rgba(21, 115, 71, .25);
  color: var(--ril-success);
}

.warning-message {
  background: var(--ril-warning-wash);
  border-color: rgba(180, 83, 9, .25);
  color: var(--ril-warning);
}

.error-message i,
.success-message i,
.warning-message i {
  font-size: 14px;
  margin-top: 1px;
  flex-shrink: 0;
}

.error-message span,
.success-message span,
.warning-message span {
  flex: 1;
}

/* validation_errors() emits <p> tags. */
.error-message span p {
  margin: 0;
}

.close-error {
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}

.close-error:hover {
  opacity: 1;
}

@keyframes ril-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .auth-panel {
    flex: 0 0 420px;
    padding: 40px 36px;
  }

  .auth-visual {
    padding: 40px;
  }

  .auth-visual h2 {
    font-size: 26px;
  }
}

/* Below this the photo panel costs more than it gives, so the form takes
   the full width. */
@media (max-width: 860px) {
  .auth-visual {
    display: none;
  }

  .auth-panel {
    flex: 1 1 auto;
    padding: 36px 24px;
    background: var(--ril-canvas);
  }

  .auth-form {
    max-width: 400px;
    background: var(--ril-surface);
    border: 1px solid var(--ril-border);
    border-radius: var(--ril-radius);
    padding: 32px 28px;
  }
}

@media (max-width: 480px) {
  .auth-panel {
    padding: 20px 14px;
  }

  .auth-form {
    padding: 26px 20px;
  }

  /* Stops iOS zooming the page when a field takes focus. */
  .auth-form input[type="email"],
  .auth-form input[type="password"],
  .auth-form input[type="text"] {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual .slide,
  .auth-dots span {
    animation: none;
  }

  .auth-visual .s1 {
    opacity: 1;
  }

  .auth-dots span:first-child {
    background: rgba(255, 255, 255, .92);
  }
}
