/* ============================================================================
   eSortcode Portal - modern login shell
   Matches Portal dashboard tokens (Inter, #EC2E5E, nav greys)

   IMPORTANT: This file is linked from the portal theme Default.aspx on every
   page. Do NOT set global body/html colours here - that breaks account/dashboard.
   Scope login-only look to .background-style / .login / .ep-login.
   ============================================================================ */

/* Full-viewport background host from PortalLoginPresenter */
.background-style {
    position: relative !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)) !important;
    box-sizing: border-box !important;
    background-color: #0f1419 !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    -webkit-background-size: cover !important;
}

/* Atmospheric overlays - depth + brand glow */
.background-style::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(236, 46, 94, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 80%, rgba(57, 66, 99, 0.55) 0%, transparent 50%),
        linear-gradient(160deg, rgba(15, 20, 25, 0.55) 0%, rgba(31, 37, 56, 0.72) 45%, rgba(15, 20, 25, 0.78) 100%);
}

.background-style::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.06) 0 1px, transparent 1.5px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.05) 0 1px, transparent 1.5px);
    background-size: 48px 48px, 72px 72px;
    animation: ep-login-drift 28s linear infinite;
}

@keyframes ep-login-drift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 48px 48px, -72px 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .background-style::after {
        animation: none;
    }
}

/* Login card */
.background-style > .login,
.background-style .login {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    max-width: 440px !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 36px 36px 32px !important;
    box-sizing: border-box !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 249, 252, 0.98) 100%) !important;
    box-shadow:
        0 28px 64px rgba(0, 0, 0, 0.35),
        0 8px 24px rgba(17, 24, 39, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.9) inset !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #111827 !important;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif !important;
}

.background-style .login--wide {
    max-width: 680px !important;
}

/* Logo */
.background-style .login__logo-client,
.background-style .login img.login__logo-client {
    display: block !important;
    width: auto !important;
    max-width: min(220px, 70%) !important;
    max-height: 48px !important;
    height: auto !important;
    margin: 0 auto 28px !important;
    object-fit: contain;
}

/* Feedback */
.background-style .login .mb20 {
    margin-bottom: 18px !important;
}

/* Form labels & rows */
.background-style .login label,
.background-style .login .row-group__row label,
.background-style .login .row-group__row > label {
    display: block !important;
    margin: 0 0 6px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    color: #374151 !important;
}

.background-style .login .row-group__row {
    margin: 0 0 16px !important;
}

.background-style .login .row-group__row .muted,
.background-style .login .muted {
    color: #6b7280 !important;
    font-weight: 500 !important;
}

/* Inputs */
.background-style .login input[type="text"],
.background-style .login input[type="password"],
.background-style .login input[type="email"],
.background-style .login input:not([type]),
.background-style .login select,
.background-style .login textarea {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 11px 14px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 15px !important;
    font-family: inherit !important;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.background-style .login input:focus,
.background-style .login select:focus,
.background-style .login textarea:focus {
    outline: none !important;
    border-color: rgba(236, 46, 94, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.14) !important;
}

/* Keep me signed in - toggle switch */
.ep-login-toggle {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 12px;
    margin: 4px 0 8px !important;
    cursor: pointer;
    user-select: none;
    min-height: 28px;
}

.ep-login-toggle__input {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%);
    width: 48px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2;
    overflow: hidden;
}

.ep-login-toggle__input input[type="checkbox"],
.background-style .login .ep-login-toggle__input input[type="checkbox"],
.ep-login .ep-login-toggle__input input[type="checkbox"] {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 48px !important;
    height: 28px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    cursor: pointer;
    z-index: 3;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ep-login-toggle__slider {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #d1d5db;
    border: 1px solid #c4c9d2;
    box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.08);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    pointer-events: none;
}

.ep-login-toggle__slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.22);
    transition: transform 0.18s ease;
}

.ep-login-toggle__input:has(input:checked) + .ep-login-toggle__slider,
.ep-login-toggle:has(input:checked) .ep-login-toggle__slider {
    background: linear-gradient(145deg, #ec2e5e, #be123c);
    border-color: rgba(190, 18, 60, 0.55);
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.12);
}

.ep-login-toggle__input:has(input:checked) + .ep-login-toggle__slider::after,
.ep-login-toggle:has(input:checked) .ep-login-toggle__slider::after {
    transform: translateX(20px);
}

.ep-login-toggle:has(input:focus-visible) .ep-login-toggle__slider,
.ep-login-toggle__input:has(input:focus-visible) + .ep-login-toggle__slider {
    outline: 2px solid rgba(236, 46, 94, 0.45);
    outline-offset: 2px;
}

.ep-login-toggle__text,
.background-style .login .ep-login-toggle__text,
.background-style .login label.ep-login-toggle__text {
    display: inline !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    line-height: 1.3;
    cursor: pointer;
}

/* Primary actions */
.background-style .login .button--primary,
.background-style .login a.button--primary,
.background-style .login .button.button--primary,
.background-style .login input.button--primary,
.background-style .login [class*="button--primary"],
.background-style .login a[data-etellect-tactile].w100--m,
.background-style .login .w100--m {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 48px !important;
    margin: 4px 0 0 !important;
    padding: 12px 20px !important;
    border: none !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #f0436d 0%, #EC2E5E 55%, #d92554 100%) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    box-shadow:
        0 10px 22px rgba(236, 46, 94, 0.32),
        0 1px 0 rgba(255, 255, 255, 0.2) inset !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    cursor: pointer;
}

.background-style .login .button--primary:hover,
.background-style .login a.button--primary:hover,
.background-style .login .w100--m:hover {
    filter: brightness(1.04);
    box-shadow:
        0 12px 28px rgba(236, 46, 94, 0.4),
        0 1px 0 rgba(255, 255, 255, 0.22) inset !important;
    color: #fff !important;
    text-decoration: none !important;
}

.background-style .login .button--primary:active,
.background-style .login .w100--m:active {
    transform: translateY(1px);
}

/* Secondary / text links */
.background-style .login a:not(.button):not(.button--primary):not(.w100--m) {
    color: #EC2E5E !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.background-style .login a:not(.button):not(.button--primary):not(.w100--m):hover {
    color: #c91f4c !important;
    text-decoration: underline !important;
}

.background-style .login .right {
    float: none !important;
}

.background-style .login .row-group__row label a.right {
    float: right !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
}

/* Validation / errors */
.background-style .login .error,
.background-style .login span.error,
.background-style .login .field-validation-error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #b91c1c !important;
}

/* Forgot-password / secondary panels */
.background-style .login p {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #4b5563;
}

.background-style .login h1,
.background-style .login h2,
.background-style .login h3 {
    margin: 0 0 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
}

.background-style .login h3 {
    font-size: 17px;
}

/* Register image strip under card */
.background-style > .cf.pt30,
.background-style .cf.pt30 {
    position: relative;
    z-index: 1;
    margin-top: 20px !important;
    padding-top: 0 !important;
    text-align: center;
}

/* ---------- Standalone MyAccount Login.ascx (if used outside presenter) ---------- */
.ep-login {
    --ep-login-primary: #EC2E5E;
    --ep-login-ink: #111827;
    --ep-login-muted: #6b7280;
    --ep-login-radius: 20px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    position: relative;
    background-color: #0f1419;
    background-image:
        linear-gradient(160deg, rgba(15, 20, 25, 0.55) 0%, rgba(31, 37, 56, 0.72) 45%, rgba(15, 20, 25, 0.78) 100%),
        url("../Images/login-background.jpg");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ep-login-ink);
}

.ep-login__card {
    width: 100%;
    max-width: 440px;
    padding: 36px 36px 32px;
    border-radius: var(--ep-login-radius);
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 249, 252, 0.98) 100%);
    box-shadow:
        0 28px 64px rgba(0, 0, 0, 0.35),
        0 8px 24px rgba(17, 24, 39, 0.18);
    position: relative;
    overflow: hidden;
}

.ep-login__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0 0 28px;
    text-align: center;
}

.ep-login__brand-logo {
    max-width: 200px;
    max-height: 44px;
    width: auto;
    height: auto;
}

.ep-login__eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ep-login-muted);
}

.ep-login__title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ep-login-ink);
}

.ep-login__sub {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ep-login-muted);
    text-align: center;
}

.ep-login .form-row,
.ep-login .login-panel .form-row {
    margin: 0 0 16px;
}

.ep-login .form-row label,
.ep-login .form-row.block-label > label {
    display: block;
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: #374151;
}

.ep-login .form-row input[type="text"],
.ep-login .form-row input[type="password"],
.ep-login .form-row input:not([type]) {
    width: 100%;
    box-sizing: border-box;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
}

.ep-login .form-row input:focus {
    outline: none;
    border-color: rgba(236, 46, 94, 0.55);
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.14);
}

.ep-login .form-button,
.ep-login input.form-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin: 8px 0 0;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #f0436d 0%, #EC2E5E 55%, #d92554 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(236, 46, 94, 0.32);
}

.ep-login .form-button.right {
    float: none;
}

.ep-login a {
    color: var(--ep-login-primary);
    font-weight: 600;
    text-decoration: none;
}

.ep-login a:hover {
    text-decoration: underline;
}

.ep-login .error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #b91c1c;
}

.ep-login .message {
    margin-bottom: 16px;
}

.ep-login .login-panel h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
}

.ep-login .clear {
    clear: both;
}

@media (max-width: 520px) {
    .background-style {
        padding: 16px 12px !important;
        align-items: flex-end !important;
    }

    .background-style .login {
        max-width: 100% !important;
        padding: 28px 22px 24px !important;
        border-radius: 18px 18px 12px 12px !important;
    }

    .ep-login {
        align-items: flex-end;
        padding: 12px;
    }

    .ep-login__card {
        padding: 28px 22px 24px;
    }
}

