/* ==========================================================================
   Login (login.html). Requires base.css.
   ========================================================================== */

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.login-wrapper {
  display: grid;
  grid-template-columns: minmax(380px, 5fr) 7fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Brand panel ---------- */
.login-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 40px 48px;
  color: #ffffff;
  background-color: #0d1534;
  background-image: radial-gradient(130% 90% at 80% 25%, #22357f 0%, #111d48 50%, #0d1534 85%);
  overflow: hidden;
  isolation: isolate;
}

/* Fine grid texture — quiet, not decorative noise */
.login-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 75%);
}

:root[data-theme="dark"] .login-showcase {
  background-color: #090f26;
  background-image: radial-gradient(130% 90% at 80% 25%, #1a2a66 0%, #0d1638 50%, #090f26 85%);
  border-right: 1px solid var(--border);
}

.showcase-body {
  display: grid;
  gap: 16px;
  max-width: 460px;
}

.login-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.login-showcase h1 {
  color: #ffffff;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.showcase-copy {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.showcase-grid {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}

.showcase-card {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.showcase-card:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.showcase-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13px;
  flex-shrink: 0;
}

.showcase-card strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
}

.showcase-card p {
  margin-top: 2px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
}

.showcase-foot {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Sign-in panel ---------- */
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.login-container {
  display: grid;
  width: 100%;
  max-width: 380px;
}

.company-logo img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.platform-title {
  margin-top: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-ink);
}

.login-container h2 {
  margin-top: 4px;
  font-size: 26px;
  letter-spacing: -0.025em;
}

.welcome-text {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

.login-fields {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.login-fields .input-field + .field-label {
  margin-top: 10px;
}

.login-fields .input-field:disabled {
  opacity: 0.8;
}

#loginSecret[type="text"] {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.3em;
}

.login-status {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}

.login-status::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 13px;
  line-height: 1.45;
}

.login-status--info {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.login-status--info::before {
  content: "\f0e0";
}

.login-status--error {
  background: var(--danger-soft);
  color: var(--danger);
}

.login-status--error::before {
  content: "\f071";
}

.login-container > .login-button {
  width: 100%;
  height: var(--control-h-lg);
  margin-top: 20px;
  font-size: 14px;
}

.or-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.or-text::before,
.or-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sso-button {
  width: 100%;
  height: var(--control-h-lg);
  font-size: 14px;
}

.sso-button .fa-microsoft {
  color: var(--text-muted);
}

.login-caption {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--text-subtle);
}

.login-caption i {
  margin-top: 3px;
  color: var(--accent);
}

/* ---------- Sign-in dialogs (new password) ---------- */
.auth-modal__kicker {
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.auth-modal__copy {
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-modal__input {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.12em;
}

/* JS toggles this with style.display */
.auth-modal__error {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--danger);
}

.auth-modal__actions .sso-button,
.auth-modal__actions .login-button {
  width: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .login-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-showcase {
    display: none;
  }

  .login-panel {
    align-items: flex-start;
    padding: 72px 20px 40px;
  }
}

@media (max-width: 480px) {
  .login-container h2 {
    font-size: 22px;
  }

  .auth-modal__actions {
    flex-direction: column-reverse;
  }

  .auth-modal__actions .sso-button,
  .auth-modal__actions .login-button {
    width: 100%;
  }
}

.change-password__second-label {
  display: block;
  margin-top: 12px;
}

/* Sign-in options (which ones show is set in the admin panel → Sign-in) */
.provider-buttons {
  display: grid;
  gap: 10px;
}

.provider-buttons .sso-button {
  width: 100%;
}

.google-slot {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

/* (SecurelyX app: provider sign-in) Continue with Apple / Microsoft, following each provider's button guidance: the
   same 40px height and 4px corners as Google's own button (rendered by Google), logo on the left, text centred.
   Apple: black in light mode, white in dark mode. Microsoft: white with a grey border, dark grey in dark mode. */
.provider-block {
  margin-top: 4px;
}

.provider-block[hidden],
.provider-btn[hidden],
.google-slot[hidden] {
  display: none;
}

.provider-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", var(--font-sans, Inter), sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease;
}

.provider-btn__logo {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.provider-btn:disabled {
  cursor: progress;
  opacity: 0.7;
}

.provider-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.provider-btn--apple {
  border: 1px solid #000000;
  background: #000000;
  color: #ffffff;
}

.provider-btn--apple:hover {
  filter: brightness(1.25);
}

.provider-btn--microsoft {
  border: 1px solid #8c8c8c;
  background: #ffffff;
  color: #5e5e5e;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, var(--font-sans, Inter), sans-serif;
}

.provider-btn--microsoft:hover {
  background: #f3f3f3;
}

:root[data-theme="dark"] .provider-btn--apple {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

:root[data-theme="dark"] .provider-btn--apple:hover {
  filter: brightness(0.92);
}

:root[data-theme="dark"] .provider-btn--microsoft {
  border-color: #2f2f2f;
  background: #2f2f2f;
  color: #ffffff;
}

:root[data-theme="dark"] .provider-btn--microsoft:hover {
  background: #3b3b3b;
}

.google-slot {
  height: 40px;
  overflow: hidden;
  /* Google's button is a light page inside a frame: with the page in dark mode the browser fills the frame's corners
     white unless the frame is light too */
  color-scheme: light;
}

/* SecurelyX wordmark on the login panel */
.showcase-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.login-wrapper--plain {
  grid-template-columns: 1fr;
}


/* (SecurelyX app) Sign-in steps: create account, confirm email, forgotten password */
.auth-code {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.3em;
}

.auth-hint {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-subtle);
}

.login-fields .auth-terms {
  margin: 8px -8px 0;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-terms input {
  margin-top: 2px;
}

.auth-terms a,
.auth-link {
  color: var(--accent);
  font-weight: 500;
}

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

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 13px;
}

.auth-switch {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}

/* (SecurelyX app) Joining a team from an invitation (join.html) */
.join-facts {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 14px 16px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken, var(--surface));
  font-size: 13.5px;
  color: var(--text-muted);
}

.join-facts li {
  display: flex;
  gap: 10px;
  line-height: 1.45;
}

.join-facts i {
  margin-top: 3px;
  color: var(--accent);
}

.join-note {
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.login-container [data-join] > .login-button {
  width: 100%;
  height: var(--control-h-lg);
  margin-top: 20px;
  font-size: 14px;
}
