/* ==========================================================================
   Login Page — Figma Q88-Specs (node 252:19430)
   Exact values from Figma design, applied via .login-page scope.
   ========================================================================== */

/* Inter is self-hosted via tokens.css @font-face (Inter-Variable.woff2).
   The earlier `@import url('https://fonts.googleapis.com/css2?family=Inter...')`
   was redundant and was blocked by the project's Content-Security-Policy
   (style-src does not whitelist fonts.googleapis.com), producing a console
   error on every page that loaded login.css — which is every page, since
   Default.master.cs registers login.css unconditionally. Removed. */

/* --------------------------------------------------------------------------
   Page Layout — fixed overlay to escape Default.Master table layout
   -------------------------------------------------------------------------- */
.login-page {
    /* QEN-8831: pre-auth page with no body.sidebar-nav, so global brand tokens
       fall back to legacy :root cyan/navy. Re-declare from the raw palette so the
       tokenized rules resolve to the Q88 brand (indigo buttons + indigo links). */
    --primary: var(--raw-indigo-600);
    --button-primary-hover: var(--raw-indigo-700);
    --text-link: var(--raw-indigo-600);
    --link-hover: var(--raw-indigo-700);
    --primary-tint: 79, 70, 229;   /* indigo-600 rgb — focus-ring tint (Q88-only page) */

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    /* `safe center` keeps the card centered when it fits, but falls back to
       top-aligned (scrollable) when a tall message overflows a short viewport —
       otherwise flex centering pushes the card top out of reach. */
    justify-content: safe center;
    align-items: center;
    background-color: #f8fafc;
    padding: 16px;
    box-sizing: border-box;
    z-index: 10000;
    overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Card — 312px wide, white, rounded, subtle shadow
   -------------------------------------------------------------------------- */
.login-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 40px;
    width: 312px;
    max-width: 312px;
    min-width: 312px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0px 1px 3px 0px #0000001a,
                0px 1px 2px -1px #0000001a;
    padding: 40px 32px;
    box-sizing: border-box;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Card Header — Veson Nautical logo only (oneVeson brand, Figma 11:2862)
   -------------------------------------------------------------------------- */
.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.login-logo {
    height: 37px;
    width: auto;
    padding: 0 !important;
    display: block;
}

/* Welcome row — sits in .login-content, 8px above the form (Figma 11:2866).
   "Welcome to" text + inline product logo image. */
.login-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    color: #6b6b73;
    margin: 0;
    white-space: nowrap;
}

.login-welcome-logo {
    height: 20px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    padding: 0 !important;
    border: 0;
}

/* --------------------------------------------------------------------------
   Card Content — form fields + request link
   -------------------------------------------------------------------------- */
.login-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* --------------------------------------------------------------------------
   ModuleTemplate chrome — hide ALL visual elements
   -------------------------------------------------------------------------- */
.login-page .modContainerSmall {
    border: none !important;
    background: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-collapse: collapse;
}

.login-page .modContainerSmall,
.login-page .modContainerSmall tbody,
.login-page .modContainerSmall tr,
.login-page .modContainerSmall td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-sizing: border-box !important;
}

.login-page .modTitle,
.login-page .modTLeft,
.login-page .modTRight,
.login-page .modTitleHeader,
.login-page .modSub1,
.login-page .modAboveLeft,
.login-page .modAboveRight,
.login-page .modBelowLeft,
.login-page .modBelowRight,
.login-page .modFooter2 {
    display: none !important;
}

.login-page .modInnerContainer {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.login-page .modMain {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Slot Content — welcome + field + button
   -------------------------------------------------------------------------- */
.login-slot-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Form Field
   -------------------------------------------------------------------------- */
.login-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.login-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #0f172a;
}

.login-input {
    width: 100% !important;
    height: 32px;
    padding: 4px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px;
    background-color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #0f172a;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease;
}

.login-input::placeholder {
    color: #475569;
    font-weight: 400;
}

.login-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-tint), 0.15);
}

/* Override Chromium/Edge autofill lavender bg — keep white per Figma.
   Inset shadow is the only way to repaint the field; transition delay
   prevents the lavender flashing on initial autofill. */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a;
    transition: background-color 5000s ease-in-out 0s;
}

/* Password field — hidden by default */
.login-field.password-section {
    display: none;
}

/* --------------------------------------------------------------------------
   Buttons — full-width teal Continue, styled Sign On
   -------------------------------------------------------------------------- */
.login-btn-continue,
.login-btn-signin {
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    background-color: var(--primary);
    border-radius: 8px;
    padding: 8px 16px;
    box-sizing: border-box;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
}

/* Continue button visible by default; Sign On hidden (shown by JS) */
.login-btn-continue {
    display: flex;
}

.login-btn-signin {
    /* Inherits button styles but stays hidden until JS shows it */
}

.login-btn-continue:hover,
.login-btn-signin:hover {
    background-color: var(--button-primary-hover);
}

.login-btn-continue:active,
.login-btn-signin:active {
    background-color: #115e59;
}

/* Hide the ImageManager icon, style the label text */
.login-btn-continue img,
.login-btn-signin img {
    display: none !important;
}

/* Apply Figma typography directly on the <a> — Continue often renders as
   bare text "<a>Continue</a>" with no inner span, so a child-only selector
   would miss it. Selector specificity (0,0,1,1) also beats MainWhiteout's
   a:link/visited/active rule which forces tahoma/bold. */
a.login-btn-continue,
a.login-btn-signin,
.login-btn-continue span,
.login-btn-continue .imageManagerLabel,
.login-btn-signin span,
.login-btn-signin .imageManagerLabel {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 20px !important;
    color: #eff6ff !important;
}

/* Override any LinkButton base styles */
.login-page a.login-btn-continue,
.login-page a.login-btn-signin,
.login-page a.login-btn-continue:link,
.login-page a.login-btn-signin:link,
.login-page a.login-btn-continue:visited,
.login-page a.login-btn-signin:visited,
.login-page a.login-btn-continue:hover,
.login-page a.login-btn-signin:hover {
    color: #eff6ff !important;
    text-decoration: none !important;
}

/* --------------------------------------------------------------------------
   Request an Account link — Figma Inter Medium 14/20, teal #0d9488.
   Selector includes a. prefix so specificity (0,0,1,1) beats
   MainWhiteout's a:link rule that forces bold. Without it, the link
   inherited the global a:link font-weight: bold + tahoma stack.
   -------------------------------------------------------------------------- */
a.login-request-account,
a.login-request-account:link,
a.login-request-account:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 20px !important;
    color: var(--text-link) !important;
    text-decoration: none !important;
    text-align: center;
}

a.login-request-account:hover {
    color: var(--link-hover) !important;
    text-decoration: underline !important;
}

/* Forgot Password link */
.login-page .forgot-password-link {
    display: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    color: var(--text-link);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Help Footer — icon + text
   -------------------------------------------------------------------------- */
.login-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-help-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.login-help span {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    color: #475569;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Static login message (help / error messages below card)
   -------------------------------------------------------------------------- */
.login-static-message {
    width: 312px;
    max-width: 312px;
    margin-top: 16px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #000;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   In-card login message banner (failed login, lockout, info, success).
   Replaces the legacy AlertBox popup, which is painted behind the .login-page
   fixed overlay (z-index:10000) and is therefore never visible on this panel.
   Populated by Signin.ascx.cs SetUI() from SessionManager.AlertInfo.
   -------------------------------------------------------------------------- */
.login-page .login-message {
    width: 100%;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

/* Links inside the banner (e.g. the "Forgot Password" call-out) inherit the
   banner's tone so they stay legible on the tinted background. */
.login-page .login-message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.login-page .login-message--error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.login-page .login-message--info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.login-page .login-message--success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

/* --------------------------------------------------------------------------
   Validation highlights
   -------------------------------------------------------------------------- */
.login-page .ValHighlight {
    color: #ef4444;
    font-size: 12px;
    margin-left: 4px;
}

/* --------------------------------------------------------------------------
   Bathymetric Watermark (matches components.css Section 12)

   Two DOM shapes to handle:
   1) Legacy iLogin.aspx (Blank.Master) — ucLogin user control, no overlay,
      body is transparent. Pseudo goes on body::before, fixed-positioned.
   2) Refreshed login.aspx (Default.Master) — .login-page is a fixed
      full-viewport overlay with its own solid background and z-index:10000
      that covers anything on body. Pseudo must be ANCHORED on .login-page
      itself so it shares the overlay's stacking context.

   login.css is loaded on many Blank.Master pages (AttachDocs, Help, popups).
   :has() guards below keep the watermark scoped to login-entry pages only.
   -------------------------------------------------------------------------- */

/* Path 1: legacy iLogin (ucLogin control, no .login-page overlay) */
body[data-portal="q88"]:has(#aspnetForm [id*="ucLogin"]):not(:has(.login-page)) {
    isolation: isolate;
}

body[data-portal="q88"]:has(#aspnetForm [id*="ucLogin"]):not(:has(.login-page))::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('/images/page/bathymetric-pattern.png');
    background-repeat: repeat-y;
    background-size: 100% auto;
    background-position: top center;
    filter: invert(1);
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
}

/* Path 2: refreshed .login-page overlay — anchor pseudo on the overlay so
   it paints ABOVE the overlay's background-color but BELOW the card.
   .login-page is already position:fixed with z-index:10000 so it has its
   own stacking context; isolation keeps the -1 layer local. */
.login-page {
    isolation: isolate;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/images/page/bathymetric-pattern.png');
    background-repeat: repeat-y;
    background-size: 100% auto;
    background-position: top center;
    filter: invert(1);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* Keep the card + static message rendered above the watermark layer */
.login-page > .login-card,
.login-page > .login-static-message {
    position: relative;
    z-index: 1;
}

/* Dark theme variant — mirrors components.css treatment */
body[data-portal="q88"][data-theme="dark"]:has(#aspnetForm [id*="ucLogin"]):not(:has(.login-page))::before,
body[data-portal="q88"][data-theme="dark"] .login-page::before {
    filter: none;
    opacity: 0.08;
}

/* Print: no watermark on paper output */
@media print {
    body[data-portal="q88"]:has(#aspnetForm [id*="ucLogin"]):not(:has(.login-page))::before,
    .login-page::before {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Hide legacy product-color bar inside the refreshed card.
   Set visible by Signin.ascx.cs when ?project=1 (line 147), tinted yellow
   on Milbros via MilbrosWhiteout.css. Figma card has no such bar.
   -------------------------------------------------------------------------- */
.login-page .divSigninPageProductBar {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Static login message — DB-driven HTML.
   - The outer asp:Panel (.login-static-message) is a transparent wrapper
     for sizing/spacing only.
   - The first child div = the visible card. We force muted bg + border +
     radius on it, overriding whatever inline yellow #fff3cd / border the
     DB HTML ships with.
   - Anything deeper inside the card gets bg/border/shadow stripped so
     nested DB-shipped wrappers don't paint colored boxes inside the card.
   - All text inside the panel is forced black.
   -------------------------------------------------------------------------- */
.login-page .login-static-message,
.login-page .login-static-message * {
    color: #000 !important;
    font-weight: 400 !important;
}

.login-page .login-static-message > div {
    background-color: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

.login-page .login-static-message > div *:not(a) {
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
