/* Login portal — video background + glass card. Loaded last so Cork/Bootstrap do not override it. */

body.login-portal,
body.login-portal.login-three {
    box-sizing: border-box;
    margin: 0 !important;
    padding: 28px 20px !important;
    min-height: 100vh !important;
    background-color: #14080c !important;
    color: #1a1a1a !important;
    font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, sans-serif !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: none !important;
    position: relative;
    overflow-x: hidden;
}

.login-video-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

    .login-video-bg video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

.login-video-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(18, 6, 10, 0.78) 0%, rgba(90, 26, 32, 0.42) 48%, rgba(12, 8, 14, 0.62) 100%),
        radial-gradient(ellipse at 70% 20%, rgba(128, 0, 32, 0.28), transparent 55%);
}

body.login-portal::before,
body.login-portal::after,
.vault-wheel-spin {
    display: none !important;
}

.login-portal #load_screen,
.login-portal #fms-page-loader {
    z-index: 40;
}

body.login-portal *,
body.login-portal *::before,
body.login-portal *::after {
    box-sizing: border-box;
    font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
}

body.login-portal i[class*="la-"],
body.login-portal i[class^="la-"],
body.login-portal .la,
body.login-portal .las,
body.login-portal .lar,
body.login-portal .lab,
body.login-portal .la::before,
body.login-portal .las::before,
body.login-portal .lar::before,
body.login-portal .lab::before {
    font-family: 'Line Awesome Free' !important;
}

body.login-portal .lab,
body.login-portal .lab::before {
    font-family: 'Line Awesome Brands' !important;
}

body.login-portal .las,
body.login-portal .las::before {
    font-weight: 900 !important;
}

body.login-portal .lar,
body.login-portal .lar::before {
    font-weight: 400 !important;
}

@keyframes fms-bg-drift {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.05) translate(-1.5%, 1%); }
    100% { transform: scale(1) translate(1%, -1%); }
}

@keyframes fms-bg-orbit {
    0% {
        background-position: 30% 20%;
    }

    25% {
        background-position: 70% 30%;
    }

    50% {
        background-position: 65% 75%;
    }

    75% {
        background-position: 25% 70%;
    }

    100% {
        background-position: 30% 20%;
    }
}

@keyframes fms-bg-glow-pulse {
    0%,
    100% {
        opacity: 0.35;
    }

    50% {
        opacity: 0.7;
    }
}

/* Vault dial: a cutout of the illustration's round wheel handle, layered on top of the
   same illustration and spun continuously in place around its own center — like a
   combination lock turning. Uses the same background-size/position formula as the base
   illustration (150% auto, centered) so it tracks the artwork at any viewport width, and
   transform-origin is computed from the wheel's fixed pixel position in the source image
   so the spin stays centered on the dial instead of the page. */


@keyframes fms-wheel-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

    body.login-portal *,
    body.login-portal *::before,
    body.login-portal *::after {
        box-sizing: border-box;
        font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
    }

body.login-portal p,
body.login-portal h1,
body.login-portal h2,
body.login-portal label,
body.login-portal span,
body.login-portal a {
    color: inherit;
}

.login-portal #load_screen {
    position: fixed;
}

.system-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.system-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #111827 !important;
    letter-spacing: -0.5px;
    margin: 0;
}

.system-header .underline {
    width: 280px;
    height: 3px;
    background: #c9a227;
    margin: 10px auto 0;
    border-radius: 2px;
}

.login-portal .main-container.login-main,
.main-container.login-main {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    align-items: center;
    gap: 48px;
    max-width: 1080px;
    width: 100%;
    margin: auto;
    flex: 1;
}

.login-brand-panel {
    color: #fff;
    padding: 8px 8px 8px 12px;
}

.login-brand-panel .brand-kicker {
    font-size: 0.78rem !important;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72) !important;
    margin: 0 0 10px !important;
}

.login-brand-panel h1 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #ffffff !important;
    margin: 0 0 14px;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.login-brand-panel .brand-copy {
    font-size: 1.05rem !important;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.86) !important;
    max-width: 420px;
    margin: 0 0 22px !important;
}

.login-brand-panel .brand-foot {
    font-size: 0.92rem !important;
    font-weight: 600;
    color: #f3d4a0 !important;
    margin: 0 !important;
}

.illustration-section {
    display: none !important;
}

.login-card {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    width: 100%;
    max-width: 440px;
    padding: 36px 34px 28px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    text-align: center;
}

    .login-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
    }

.logo-container {
    margin-bottom: 24px;
}

.logo-img-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.logo-container img,
.logo-img {
    display: inline-block !important;
    max-width: 170px;
    max-height: 70px;
    height: auto;
    object-fit: contain;
}

.logo-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.15rem;
    font-weight: 700;
    color: #c41e3a;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-subtitle {
    font-size: 0.72rem;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 2.4px;
    margin-top: 6px;
}

.logo-tag {
    font-size: 0.62rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-top: 4px;
}

.welcome-text {
    font-size: 0.9rem !important;
    color: #6b7280 !important;
    margin-bottom: 6px !important;
}

.form-title {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 28px !important;
}

.login-card .input-group {
    display: block;
    text-align: left;
    margin-bottom: 16px;
    width: 100%;
}

.login-card .input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151 !important;
    margin-bottom: 8px;
}

.phone-input-wrapper,
.plain-input-wrapper {
    display: flex;
    align-items: center;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-input-wrapper:focus-within,
.plain-input-wrapper:focus-within {
    border-color: #800020;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.16);
}

.country-flag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 10px;
    border-right: 1px solid #d1d5db;
    font-size: 0.85rem;
    color: #4b5563;
    flex-shrink: 0;
}

.country-flag img {
    display: inline-block;
}

.flag-in {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    display: inline-block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 225 150'%3E%3Crect width='225' height='150' fill='%23FF9933'/%3E%3Crect y='50' width='225' height='50' fill='%23FFFFFF'/%3E%3Crect y='100' width='225' height='50' fill='%23138808'/%3E%3Cg transform='translate(112.5, 75)'%3E%3Ccircle r='20' fill='none' stroke='%23000080' stroke-width='2'/%3E%3Ccircle r='3.5' fill='%23000080'/%3E%3Cg stroke='%23000080' stroke-width='1.2'%3E%3Cline x1='0' y1='-20' x2='0' y2='20'/%3E%3Cline x1='-20' y1='0' x2='20' y2='0'/%3E%3Cline x1='-14.14' y1='-14.14' x2='14.14' y2='14.14'/%3E%3Cline x1='-14.14' y1='14.14' x2='14.14' y2='-14.14'/%3E%3Cline x1='-7.65' y1='-18.48' x2='7.65' y2='18.48'/%3E%3Cline x1='-18.48' y1='-7.65' x2='18.48' y2='7.65'/%3E%3Cline x1='-18.48' y1='7.65' x2='18.48' y2='-7.65'/%3E%3Cline x1='-7.65' y1='18.48' x2='7.65' y2='-18.48'/%3E%3Cline x1='-3.47' y1='-19.7' x2='3.47' y2='19.7'/%3E%3Cline x1='-19.7' y1='-3.47' x2='19.7' y2='3.47'/%3E%3Cline x1='-19.7' y1='3.47' x2='19.7' y2='-3.47'/%3E%3Cline x1='-3.47' y1='19.7' x2='3.47' y2='-19.7'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
    position: relative;
    flex-shrink: 0;
}

.country-flag .flag-caret {
    font-size: 0.65rem;
    color: #6b7280;
    margin-left: 1px;
    line-height: 1;
}

.phone-input-wrapper input,
.plain-input-wrapper input,
.login-card .form-control {
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 12px !important;
    height: auto !important;
    font-size: 0.95rem;
    color: #111827 !important;
    outline: none !important;
}

.login-card .captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.login-card .captcha-row img#img-captcha {
    height: 44px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.login-card .captcha-row input.form-control {
    flex: 1 1 140px;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: #800020 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease, background 0.2s ease;
}

.btn-submit:hover,
.btn-submit:focus {
    background: #5d0017 !important;
    opacity: 1;
    color: #ffffff !important;
}

.btn-submit:hover,
.btn-submit:focus {
    opacity: 0.95;
    color: #ffffff !important;
}

.btn-submit:active {
    transform: scale(0.99);
}

.links-container {
    margin-top: 20px;
    font-size: 0.85rem;
}

.links-container.links-row,
.links-container:has(.forgot-link):has(.signup-link) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.links-container.links-row a,
.links-container:has(.forgot-link):has(.signup-link) a,
.links-container:has(.forgot-link):has(.signup-link) .password-label-row {
    display: inline-block;
    margin: 0;
}

.links-container a {
    display: block;
    color: #4b5563 !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.links-container a:hover {
    color: #111827 !important;
    text-decoration: underline;
}

.forgot-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 4px;
    color: #800020 !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.forgot-link:hover,
.forgot-link:focus {
    color: #5d0017 !important;
    text-decoration: underline;
    opacity: 0.9;
}

    .forgot-link i {
        font-family: "Line Awesome Free" !important;
        font-weight: 900 !important;
        font-style: normal !important;
        font-size: 16px;
        display: inline-block;
        margin-right: 5px;
    }

.signup-link {
    margin-top: 10px;
    display: block;
    color: #1A3D3C !important;
    font-weight: 600;
}

.footer-tagline {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82) !important;
    margin-top: 24px;
    letter-spacing: -0.2px;
    width: 100%;
}

.login-card .session-row {
    text-align: left;
    font-size: 0.82rem;
    color: #4b5563 !important;
    margin-bottom: 16px;
}

.login-card .text-danger,
.login-card .field-validation-error {
    display: block;
    text-align: left;
    font-size: 0.8rem;
    margin-top: 6px;
}

.login-card #safeTimerDisplay {
    margin: 12px 0 0;
    color: #1A3D3C !important;
    font-weight: 600;
}

@media (max-width: 900px) {
    .login-portal .main-container.login-main,
    .main-container.login-main {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 440px;
    }

    .login-brand-panel {
        text-align: center;
        padding: 0 4px 4px;
    }

    .login-brand-panel h1 {
        font-size: 1.7rem;
    }

    .login-brand-panel .brand-copy {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .system-header h1 {
        font-size: 1.45rem;
    }

    .login-card {
        padding: 28px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-video-bg video {
        display: none;
    }
}

/* ---- Card entrance: staggered fade + slide for logo, heading, fields, actions ---- */

@keyframes fms-fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card > * {
    animation: fms-fade-slide-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-card > .logo-container {
    animation-delay: 0.05s;
}

.login-card > .welcome-text {
    animation-delay: 0.18s;
}

.login-card > .form-title {
    animation-delay: 0.3s;
}

.login-card > form {
    animation-delay: 0.42s;
}

.login-card > .links-container {
    animation-delay: 0.78s;
}

.login-card form > * {
    animation: fms-fade-slide-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-card form > .input-group:nth-of-type(1) {
    animation-delay: 0.48s;
}

.login-card form > .input-group:nth-of-type(2) {
    animation-delay: 0.56s;
}

.login-card form > .input-group:nth-of-type(3) {
    animation-delay: 0.64s;
}

.login-card form > .captcha-row {
    animation-delay: 0.62s;
}

.login-card form > .session-row {
    animation-delay: 0.68s;
}

.login-card form > .btn-submit {
    animation-delay: 0.72s;
}

/* ---- Interaction polish ---- */

.phone-input-wrapper,
.plain-input-wrapper,
.login-card .captcha-row input.form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-submit {
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.btn-submit:hover,
.btn-submit:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(26, 61, 60, 0.25);
}

.btn-submit:active {
    transform: scale(0.99) translateY(0);
    box-shadow: none;
}

/* ---- Respect reduced-motion preference: disable all added animation/transition motion ---- */

@media (prefers-reduced-motion: reduce) {
    body.login-portal::before,
    body.login-portal::after,
    .vault-wheel-spin,
    .login-card > *,
    .login-card form > * {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    body.login-portal::before {
        background-size: 150% auto;
    }

    .login-card,
    .login-card:hover,
    .phone-input-wrapper,
    .plain-input-wrapper,
    .login-card .captcha-row input.form-control,
    .btn-submit,
    .btn-submit:hover,
    .btn-submit:focus,
    .btn-submit:active,
    .links-container a {
        transition: none !important;
        transform: none !important;
    }
}
