/* Auth forms — login.php, locked.php, break-user.php. Minimal. Fluid. */

/* ---- .login_sys_info responsive overrides ----
   Bottom-left system info panel shown on the auth pages. The base rule in
   style.css uses fixed 380x200 with position:fixed + negative margins.
   These overrides keep that desktop layout but reflow it to a static,
   full-width block on narrower screens so it no longer overlaps the card
   or gets clipped off the edge. */
.login_sys_info {
  max-width: min(380px, calc(100vw - 20px));
  box-sizing: border-box;
  word-wrap: break-word;
  line-height: 1.5;
  text-align: left;
}

/* The JS template wraps the logo in a flex div with inline
   justify-content:flex-end. Override so the logo aligns with the text
   block below it instead of hugging the opposite edge. */
.login_sys_info .d-flex {
  justify-content: flex-start !important;
}

.login_sys_info img {
  max-width: 100%;
  height: auto !important;
  width: auto !important;
  max-height: 60px;
  margin-left: 0 !important;
}

.login_sys_info label {
  display: block;
  margin-left: 0 !important;
  margin-bottom: 2px;
}

@media (max-width: 768px) {
  .login_sys_info {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 16px 0 0 !important;
    padding: 16px !important;
    text-align: center !important;
    font-size: 11px !important;
  }
  .login_sys_info .d-flex {
    justify-content: center !important;
  }
  .login_sys_info img { max-height: 48px; }
}

@media (max-width: 480px) {
  .login_sys_info {
    padding: 12px !important;
    font-size: 10px !important;
  }
  .login_sys_info img { max-height: 36px; }
}


.tp-auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  /* Reserve room for the fixed .login_sys_info panel so tall viewports
     don't let it creep behind the card. Short/mobile viewports below
     override this to reclaim space. */
  padding-bottom: clamp(80px, 18vh, 200px);
  background: var(--background-color);
  box-sizing: border-box;
}

.tp-auth-card {
  width: 100%;
  max-width: clamp(280px, 90vw, 420px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 16px);
  box-sizing: border-box;
}

.tp-auth-card form {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 14px);
  margin: 0;
}

.tp-auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.tp-auth-logo img {
  max-height: clamp(48px, 10vw, 80px);
  max-width: 100%;
  object-fit: contain;
}

/* Login page only: the company logo is the main visual, scale it up. */
.tp-auth-logo .com_logo {
  max-height: clamp(120px, 22vw, 220px);
}

@media (max-height: 560px) {
  .tp-auth-logo .com_logo { max-height: 90px; }
}

.tp-auth-heading {
  text-align: center;
  color: var(--text-color);
  margin: 0;
}

.tp-auth-heading h1 {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 700;
  margin: 0;
}

.tp-auth-heading p {
  margin: 4px 0 0;
  font-size: clamp(11px, 1.4vw, 13px);
  color: var(--information-color);
}

.tp-auth-user {
  text-align: center;
  color: var(--text-color);
  font-size: clamp(12px, 1.4vw, 14px);
}

.tp-auth-user .tp-auth-meta {
  color: var(--information-color);
  font-size: clamp(10px, 1.2vw, 12px);
  margin-top: 2px;
}

.tp-auth-field {
  display: flex;
  align-items: center;
  background: var(--secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.tp-auth-field:focus-within {
  border-color: var(--primary-color);
}

.tp-auth-field .tp-auth-icon {
  padding: 0 clamp(8px, 1.5vw, 12px);
  color: var(--information-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.tp-auth-field .tp-auth-icon svg {
  width: clamp(18px, 2.2vw, 22px);
  height: clamp(18px, 2.2vw, 22px);
}

.tp-auth-field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-color);
  padding: clamp(10px, 1.4vw, 12px) clamp(10px, 1.4vw, 12px) clamp(10px, 1.4vw, 12px) 0;
  font-size: clamp(13px, 1.6vw, 14px);
}

.tp-auth-field input::placeholder {
  color: var(--information-color);
}

.tp-auth-btn {
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: clamp(10px, 1.4vw, 12px);
  font-size: clamp(13px, 1.6vw, 14px);
  font-weight: 600;
  cursor: pointer;
}

.tp-auth-btn:hover { opacity: 0.9; }

/* While a login is in flight the button is disabled to block a second
   submission (which the server would reject as "already logged in on
   another session"). */
.tp-auth-btn:disabled,
.tp-auth-btn.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.tp-auth-lapse {
  text-align: center;
  color: var(--information-color);
  font-size: clamp(11px, 1.4vw, 12px);
}

.tp-auth-lapse strong {
  color: var(--text-color);
  font-weight: 600;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* Mobile portrait: drop the reserved bottom padding since .login_sys_info
   stacks below the viewport flow on small screens. */
@media (max-width: 600px) {
  .tp-auth-wrap {
    padding-bottom: clamp(20px, 4vw, 40px);
  }
}

/* Short viewports (landscape phones, split-screen). Tighten vertical space
   so the card stays visible without scrolling. */
@media (max-height: 560px) {
  .tp-auth-wrap {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .tp-auth-logo img { max-height: 48px; }
  .tp-auth-card { gap: 10px; }
}

/* Extra-narrow devices (older phones, watches). */
@media (max-width: 340px) {
  .tp-auth-card { max-width: 100%; }
  .tp-auth-heading h1 { font-size: 14px; }
}
