/* ==========================================================================
   Login page split brand panel + form.
   Owning feature: account
   Load order is defined in Views/Shared/_CssIncludes.cshtml — do not reorder.
   ========================================================================== */

/* ==========================================================================
   Login page — split brand panel + form (FileHub tokens + SiHub logo)
   ========================================================================== */
.fh-login-body {
  margin: 0;
  background: var(--fh-bg);
  font-family: var(--fh-font-sans);
}

.fh-login-root {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* 100svh (small viewport height) on mobile: with plain 100vh the page is
     sized to the viewport *without* the browser's collapsible URL bar, so on
     iOS/Android Chrome the login card sat partly under the address bar on
     first paint and the page scrolled by exactly the bar's height. The vh
     line stays first as the fallback for older engines. */
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  font-family: var(--fh-font-sans);
  background: var(--fh-bg);
  padding: clamp(1rem, 3vh, 2rem) var(--fh-gutter);
  box-sizing: border-box;
}

.fh-login-shell {
  display: flex;
  flex: 0 1 auto;
  width: min(100%, var(--fh-read-max, 72rem));
  min-height: 580px;
  border-radius: var(--bs-border-radius-2xl, 1.25rem);
  overflow: hidden;
  box-shadow: var(--fh-shadow);
  background: #ffffff;
}

.fh-login-mobile-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: var(--fh-primary);
  flex-shrink: 0;
}

.fh-login-mobile-logo {
  background: #ffffff;
  border-radius: var(--fh-radius-sm);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fh-login-mobile-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.fh-login-mobile-title {
  color: #ffffff;
  font-weight: var(--fh-weight-bold);
  font-size: var(--fh-text-md);
  line-height: var(--fh-leading-tight);
}

.fh-login-mobile-sub {
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--fh-text-xs);
  letter-spacing: var(--fh-tracking-wide);
  margin-top: 2px;
}

.fh-login-brand {
  position: relative;
  /* Cap the brand column so ultra-wide screens keep a panel, not a void. */
  flex: 0 0 auto;
  width: clamp(300px, 42%, 480px);
  background: linear-gradient(160deg, var(--fh-primary) 0%, var(--fh-primary-dark) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.5rem, 1rem + 1.6vw, 2.75rem) clamp(1.25rem, 0.8rem + 1.2vw, 2.25rem);
  color: #ffffff;
}

.fh-login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.06) 1.2px, transparent 1.4px);
  background-size: 20px 20px;
  pointer-events: none;
}

.fh-login-brand-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fh-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.35rem 0.75rem;
  border-radius: var(--bs-border-radius-pill, 50rem);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-semibold);
  letter-spacing: var(--fh-tracking-wide);
  line-height: var(--fh-leading-none);
}

.fh-login-badge i {
  font-size: var(--fh-text-sm);
  opacity: 0.9;
}

.fh-login-brand-title {
  color: #ffffff;
  font-size: var(--fh-text-4xl);
  font-weight: var(--fh-weight-bold);
  line-height: var(--fh-leading-tight);
  margin: 0;
  letter-spacing: var(--fh-tracking-tighter);
}

.fh-login-brand-center {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.fh-login-logo-card {
  background: #ffffff;
  border-radius: var(--bs-border-radius-2xl, 1.25rem);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
  max-width: 280px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fh-login-logo-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.fh-login-brand-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--fh-text-sm);
  line-height: var(--fh-leading-normal);
  text-align: center;
  max-width: 22rem;
}

.fh-login-brand-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fh-login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fh-login-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--fh-radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--fh-text-sm);
  line-height: var(--fh-leading-snug);
}

.fh-login-chip i {
  flex-shrink: 0;
  color: #ffffff;
  font-size: var(--fh-text-xs);
}

.fh-login-brand-note {
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--fh-text-xs);
  margin: 0;
  letter-spacing: var(--fh-tracking-wide);
}

.fh-login-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 1.5rem + 2vw, 3.5rem) clamp(1.5rem, 1rem + 1.5vw, 3rem);
  position: relative;
  background: #ffffff;
}

.fh-login-form-box {
  width: 100%;
  max-width: 390px;
}

.fh-login-header {
  margin-bottom: 2rem;
}

.fh-login-title {
  font-size: var(--fh-text-4xl);
  font-weight: var(--fh-weight-bold);
  color: var(--fh-text);
  margin: 0;
  letter-spacing: var(--fh-tracking-tighter);
  line-height: var(--fh-leading-tight);
}

.fh-login-subtitle {
  color: var(--fh-muted);
  font-size: var(--fh-text-md);
  margin: 0.625rem 0 0;
  line-height: var(--fh-leading-normal);
}

.fh-login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fh-login-field {
  display: flex;
  flex-direction: column;
}

.fh-login-label {
  display: block;
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
  margin-bottom: 0.5rem;
}

.fh-login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.fh-login-input-icon {
  position: absolute;
  left: 0.875rem;
  color: var(--fh-muted);
  font-size: var(--fh-text-sm);
  pointer-events: none;
}

.fh-login-input {
  width: 100%;
  height: 46px;
  padding: 0 0.875rem 0 2.5rem;
  border: 1.5px solid var(--fh-form-border, #cbd5e1);
  border-radius: var(--fh-radius);
  font-size: var(--fh-text-md);
  color: var(--fh-text);
  background: var(--fh-form-bg, #ffffff);
  outline: none;
  cursor: text;
  transition: background-color var(--fh-transition-fast), border-color var(--fh-transition-fast), box-shadow var(--fh-transition-fast);
  font-family: inherit;
  box-sizing: border-box;
}

.fh-login-input::placeholder {
  color: var(--fh-muted);
  opacity: 1;
}

.fh-login-input:hover:not(:disabled):not([readonly]):not(:focus) {
  border-color: var(--fh-form-border-hover, #94a3b8);
}

.fh-login-input:focus {
  border-color: var(--fh-primary);
  box-shadow: var(--fh-focus-ring);
  background: #ffffff;
}

.fh-login-input:disabled,
.fh-login-input[readonly] {
  background: var(--fh-soft, #f1f5f9);
  color: var(--fh-muted, #94a3b8);
  border-color: var(--fh-form-border-disabled, #e2e8f0);
  cursor: not-allowed;
}

.fh-login-pw-wrap .fh-login-input {
  padding-right: 2.75rem;
}

.fh-login-pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--fh-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fh-text-md);
  transition: color var(--fh-transition-fast);
}

.fh-login-pw-toggle:hover {
  color: var(--fh-text);
}

.fh-login-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.fh-login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  padding: 0.125rem 0;
  min-height: 1.75rem;
  min-width: 0;
  max-width: 100%;
  cursor: pointer;
  user-select: none;
}

/* asp-for checkbox emits a sibling hidden=false field; keep it out of the flex row. */
.fh-login-remember > input[type="hidden"] {
  display: none !important;
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
}

.fh-login-remember-input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex-shrink: 0;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--fh-radius-sm, 0.35rem);
  cursor: pointer;
  vertical-align: middle;
  print-color-adjust: exact;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: background-color var(--fh-transition-fast),
              border-color var(--fh-transition-fast),
              box-shadow var(--fh-transition-fast),
              transform 0.1s ease;
}

.fh-login-remember-input:hover:not(:disabled) {
  border-color: var(--fh-primary);
  background-color: var(--fh-primary-soft, #eff6ff);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.fh-login-remember-input:active:not(:disabled) {
  transform: scale(0.92);
}

.fh-login-remember-input:checked {
  background-color: var(--fh-primary);
  border-color: var(--fh-primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.75' d='m4.5 10 3.8 4 7.2-8'/%3e%3c/svg%3e");
}

.fh-login-remember-input:focus-visible {
  outline: none;
  border-color: var(--fh-primary);
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

.fh-login-remember-input:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.fh-login-remember-text {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-medium);
  color: var(--fh-muted);
  line-height: var(--fh-leading-snug);
  min-width: 0;
}

.fh-login-remember:hover .fh-login-remember-text {
  color: var(--fh-text);
}

.fh-login-submit-btn {
  width: 100%;
  height: 48px;
  background: var(--fh-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--fh-radius);
  font-size: var(--fh-text-md);
  font-weight: var(--fh-weight-semibold);
  cursor: pointer;
  transition: background-color var(--fh-transition-fast), transform 0.1s ease, box-shadow var(--fh-transition-fast);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--fh-shadow-sm);
}

.fh-login-submit-btn:hover {
  background: var(--fh-primary-dark);
  color: #ffffff;
}

.fh-login-submit-btn:focus-visible {
  outline: 2px solid var(--fh-primary);
  outline-offset: 2px;
}

.fh-login-submit-btn:active {
  transform: scale(0.985);
}

.fh-login-secured {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin: 1.25rem 0 0;
  color: var(--fh-muted);
  font-size: var(--fh-text-xs);
  line-height: var(--fh-leading-snug);
}

.fh-login-lang-switch {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.fh-login-lang-btn {
  border: 0;
  background: transparent;
  width: 34px;
  height: 28px;
  padding: 0;
  border-radius: var(--bs-border-radius-pill, 50rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fh-transition-fast);
  cursor: pointer;
  box-sizing: border-box;
}

.fh-login-lang-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
}

.fh-login-lang-btn.active {
  background: var(--fh-primary);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  cursor: default;
}

.fh-login-lang-btn:focus-visible {
  outline: 2px solid var(--fh-primary);
  outline-offset: 1px;
}

.fh-login-lang-btn:not(.active) .fh-flag-icon {
  opacity: 0.55;
}

.fh-login-lang-btn:hover:not(.active) .fh-flag-icon {
  opacity: 1;
  transform: scale(1.05);
}

.fh-login-lang-btn.active .fh-flag-icon {
  opacity: 1;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.35));
}

/* .98 upper bound: at exactly 768px the brand panel was hidden *and* the
   desktop two-column rule still applied, so the tablet-portrait login page
   dropped its branding for no reason. */
@media (max-width: 767.98px) {
  .fh-login-root {
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
  }
  .fh-login-shell {
    flex-direction: column;
    width: 100%;
    min-height: 0;
    flex: 1;
    border-radius: 0;
    box-shadow: none;
  }
  .fh-login-brand {
    display: none;
  }
  .fh-login-mobile-bar {
    display: flex;
  }
  .fh-login-form-panel {
    padding: 2.5rem 1.25rem;
    align-items: center;
    background: var(--fh-soft);
  }
  .fh-login-form-box {
    max-width: 100%;
  }
  .fh-login-form {
    gap: 1.1rem;
  }
  .fh-login-options {
    width: 100%;
  }
}

@media (max-width: 399.98px) {
  .fh-login-form-panel {
    padding: 1.75rem 1rem 2rem;
  }
  .fh-login-header {
    margin-bottom: 1.5rem;
  }
  .fh-login-remember-text {
    font-size: var(--fh-text-base);
  }
}

@media (min-width: 1920px) and (max-width: 2559.98px) {
  .fh-login-shell { min-height: 640px; }
  .fh-login-brand { width: clamp(340px, 38%, 36rem); }
  .fh-login-form-box { max-width: 28rem; }
}
@media (min-width: 2560px) {
  .fh-login-shell { min-height: 700px; }
  .fh-login-brand { width: clamp(380px, 36%, 40rem); }
  .fh-login-form-panel { padding: 3.75rem 3.5rem; }
  .fh-login-form-box { max-width: 32rem; }
}
