﻿/* App login page, Views/Account/Login.cshtml
   The page still loads bootstrap, style.bundle and custom.css for the waiver modal, so the rules here are scoped to .rml.
   --rml-accent / --rml-on-accent (main color and its readable text color) are set in the view from the style settings.
   style.bundle sets "outline: none !important" on links and buttons, so focus rings are drawn with box-shadow. */

.rml {
    --rml-ink: #1F2328;
    --rml-text: #4B5159;
    --rml-subtle: #6B7280;
    --rml-border: #CDD2D8;
    --rml-divider: #E6E8EB;
    --rml-danger: #B42318;
    --rml-focus: 0 0 0 2px #FFFFFF, 0 0 0 4px #1F2328;
    --rml-focus-on-photo: 0 0 0 2px rgba(8,12,20,.6), 0 0 0 4px #FFFFFF;
    margin: 0;
    background: #0A0E14;
    color: var(--rml-ink);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

    .rml *, .rml *::before, .rml *::after {
        box-sizing: border-box;
    }

    .rml [hidden] {
        display: none !important;
    }

.rml-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Page: photo or video, darkened on the right where the title is ---------- */

.rml-page {
    position: relative;
    flex: 1 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #0A0E14;
    background-image: url('../../../Images/app/login-bg-image.png');
    background-size: cover;
    background-position: 40% center;
}

.rml-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rml-scrim {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(270deg, rgba(8,12,20,.68) 0%, rgba(8,12,20,.38) 55%, rgba(8,12,20,.28) 100%);
}

/* ---------- Header with the language menu ---------- */

.rml-header {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    padding: 24px clamp(16px, 4vw, 48px);
}

.rml-lang {
    position: relative;
}

.rml .rml-lang__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px 0 14px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

    .rml .rml-lang__btn:hover {
        background: rgba(255,255,255,.18);
    }

    .rml .rml-lang__btn:focus-visible {
        box-shadow: var(--rml-focus-on-photo);
    }

    .rml-lang__chevron {
        transition: transform .15s ease;
    }

    .rml-lang__btn[aria-expanded="true"] .rml-lang__chevron {
        transform: rotate(180deg);
    }

.rml .rml-lang__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    min-width: 220px;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid var(--rml-divider);
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 12px 32px rgba(16,24,40,.24);
}

.rml .rml-lang__item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--rml-ink);
    font-size: 14px;
    text-decoration: none;
}

    .rml .rml-lang__item:hover,
    .rml .rml-lang__item[aria-current="true"] {
        background: #F4F5F7;
        color: var(--rml-ink);
    }

    .rml .rml-lang__item:focus-visible {
        box-shadow: inset 0 0 0 2px var(--rml-ink);
    }

.rml-lang__code {
    width: 44px;
    flex: none;
    font-weight: 600;
}

.rml-lang__name {
    flex: 1;
}

/* ---------- Layout: login card on the left, title on the right ---------- */

.rml-main {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 8px clamp(16px, 4vw, 48px) 48px;
}

.rml-brand {
    order: -1;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    text-align: center;
}

.rml-brand__eyebrow {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.rml-brand__title {
    font-size: clamp(32px, 8vw, 44px);
    line-height: 1.05;
    font-weight: 600;
    overflow-wrap: break-word;
    hyphens: auto;
}

@media (min-width: 960px) {
    .rml-main {
        flex-direction: row;
        justify-content: space-between;
        gap: 64px;
        padding-bottom: 64px;
    }

    .rml-brand {
        order: 0;
        flex: 1 1 360px;
        max-width: 640px;
        align-items: flex-end;
        gap: 14px;
        text-align: right;
    }

    .rml-brand__eyebrow {
        font-size: 15px;
    }

    .rml-brand__title {
        font-size: clamp(48px, 5.6vw, 84px);
        line-height: 1.02;
    }
}

/* ---------- Card ---------- */

.rml-card {
    width: 100%;
    max-width: 440px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: clamp(24px, 5vw, 40px);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 24px 60px rgba(10,14,20,.35);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .rml-card {
        background: rgba(255,255,255,.92);
        -webkit-backdrop-filter: blur(20px) saturate(1.4);
        backdrop-filter: blur(20px) saturate(1.4);
    }
}

@media (min-width: 960px) {
    .rml-card {
        flex: 0 0 440px;
    }
}

.rml-card__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.rml-logo {
    display: block;
    width: auto;
    max-width: min(260px, 100%);
    height: auto;
    object-fit: contain;
}

.rml .rml-title {
    margin: 0;
    color: var(--rml-ink);
    font-size: 24px;
    line-height: 1.3;
    font-weight: 600;
}

.rml-card__foot {
    padding-top: 20px;
    border-top: 1px solid var(--rml-divider);
}

/* ---------- Form ---------- */

.rml-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
}

.rml-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rml-label-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

.rml .rml-label {
    display: block;
    margin: 0;
    color: var(--rml-ink);
    font-size: 14px;
    font-weight: 500;
}

.rml .rml-link {
    color: var(--rml-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

    .rml .rml-link:hover {
        color: #000000;
        text-decoration: underline;
    }

    .rml .rml-link:focus-visible {
        border-radius: 4px;
        box-shadow: var(--rml-focus);
    }

.rml-control {
    position: relative;
}

.rml-control__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--rml-subtle);
    pointer-events: none;
}

/* 16px, smaller text makes iOS zoom into the field */
.rml .rml-input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px 0 44px;
    border: 1px solid var(--rml-border);
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--rml-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    box-shadow: none;
}

    .rml .rml-input:focus {
        outline: none;
        border-color: var(--rml-ink);
        box-shadow: 0 0 0 3px rgba(31,35,40,.2);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--rml-accent) 40%, transparent);
    }

    .rml .rml-input[aria-invalid="true"] {
        border-color: var(--rml-danger);
    }

.rml .rml-input--password {
    padding-right: 52px;
}

    /* Edge shows its own eye in password fields, ours is the button next to it */
    .rml .rml-input--password::-ms-reveal,
    .rml .rml-input--password::-ms-clear {
        display: none;
    }

.rml .rml-eye {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--rml-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .rml .rml-eye:hover {
        background: rgba(31,35,40,.06);
    }

    .rml .rml-eye:focus-visible {
        box-shadow: inset 0 0 0 2px var(--rml-ink);
    }

.rml-eye__hide,
.rml-eye[aria-pressed="true"] .rml-eye__show {
    display: none;
}

.rml-eye[aria-pressed="true"] .rml-eye__hide {
    display: block;
}

.rml .rml-field__error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--rml-danger);
    font-size: 13px;
    line-height: 1.4;
}

    .rml-field__error svg {
        flex: none;
    }

.rml .rml-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #F5C2C0;
    border-radius: 12px;
    background: #FDECEC;
    color: #A1231B;
    font-size: 14px;
    line-height: 1.5;
}

    .rml-alert svg {
        flex: none;
    }

/* ---------- Steps: password, then the PIN of the two-factor login ---------- */

.rml-step {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rml-pin-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.rml-pin-head__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: #F4F5F7;
    color: var(--rml-ink);
}

.rml .rml-subtitle {
    margin: 0;
    color: var(--rml-ink);
    font-size: 18px;
    line-height: 1.35;
    font-weight: 600;
}

    .rml .rml-subtitle:focus {
        outline: none;
    }

.rml .rml-text {
    margin: 0;
    color: var(--rml-text);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.rml .rml-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #C9DAF2;
    border-radius: 12px;
    background: #F2F7FD;
    color: #1F3A5F;
    font-size: 14px;
    line-height: 1.5;
}

    .rml-notice svg {
        flex: none;
    }

/* the 6 digits, spaced */
.rml .rml-input--pin {
    padding: 0 14px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .4em;
    font-variant-numeric: tabular-nums;
}

    .rml .rml-input--pin::placeholder {
        letter-spacing: normal;
    }

.rml .rml-status {
    margin: 0;
    color: #146C43;
    font-size: 14px;
    line-height: 1.5;
}

    .rml .rml-status:empty {
        display: none;
    }

.rml-pin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    padding-top: 16px;
    border-top: 1px solid var(--rml-divider);
}

.rml .rml-link-btn {
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--rml-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

    .rml .rml-link-btn:hover {
        color: #000000;
    }

    .rml .rml-link-btn:focus-visible {
        box-shadow: var(--rml-focus);
    }

    .rml .rml-link-btn:disabled {
        color: var(--rml-subtle);
        cursor: default;
    }

/* ---------- Buttons ---------- */

.rml .rml-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0 16px;
    border-radius: 12px;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

    .rml .rml-btn:focus-visible {
        box-shadow: var(--rml-focus);
    }

.rml .rml-btn--primary {
    min-height: 50px;
    margin-top: 4px;
    border: 0;
    background: var(--rml-accent);
    color: var(--rml-on-accent);
    font-size: 16px;
    font-weight: 600;
}

    .rml .rml-btn--primary:hover {
        filter: brightness(.95);
    }

    .rml .rml-btn--primary:active {
        transform: translateY(1px);
    }

    .rml .rml-btn--primary:disabled {
        cursor: default;
        filter: none;
        transform: none;
    }

    .rml .rml-btn--primary.is-busy {
        cursor: progress;
    }

.rml-spinner {
    display: none;
    animation: rml-spin .8s linear infinite;
}

.rml-btn.is-busy .rml-spinner {
    display: block;
}

@keyframes rml-spin {
    to {
        transform: rotate(360deg);
    }
}

.rml .rml-btn--secondary {
    min-height: 48px;
    border: 1px solid var(--rml-border);
    background: #FFFFFF;
    color: var(--rml-ink);
    font-size: 15px;
    font-weight: 500;
}

    .rml .rml-btn--secondary:hover {
        background: #F6F7F8;
        color: var(--rml-ink);
        text-decoration: none;
    }

@media (prefers-reduced-motion: reduce) {
    .rml-spinner {
        animation-duration: 2s;
    }

    .rml-lang__chevron {
        transition: none;
    }
}
