@import url('../webfonts/fonts.css');

:root {
    --fp-primary: #0066CC;
    --fp-primary-hover: #0052A3;
    --fp-tint: #E6F2FF;
    --fp-ink: #0f172a;
    --fp-muted: #64748b;
    --fp-border: #e2e8f0;
    --fp-danger: #dc2626;
    --fp-ok: #059669;
    --fp-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.flx-auth {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f7fb;
    color: var(--fp-ink);
    min-height: 100vh;
}

.flx-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(400px, 45%) 1fr;
}

.flx-brand {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: clamp(3rem, 7vh, 5rem) clamp(2.25rem, 4.5vw, 4.5rem);
    color: #fff;
    background: #06458d;
    overflow: hidden;
    isolation: isolate;
}

.flx-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 58, 123, 0.92), rgba(0, 61, 126, 0.6) 48%, rgba(0, 39, 88, 0.08)),
        linear-gradient(180deg, rgba(0, 32, 75, 0.25), transparent 60%);
    pointer-events: none;
}

.flx-brand-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 26rem;
    text-shadow: 0 2px 16px rgba(0, 20, 50, 0.2);
}

.flx-brand-logo img {
    display: block;
    height: auto;
    width: 280px;
    max-width: 100%;
    filter: brightness(0) invert(1);
    margin-bottom: 2rem;
}

.flx-brand-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.flx-chip {
    display: inline-block;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0.9rem;
}

.flx-brand h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.4rem;
}

.flx-lede {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
    line-height: 1.6;
    color: #dbeafe;
}

.flx-benefits {
    list-style: none;
    max-width: 25rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.flx-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.95);
}

.flx-benefits svg {
    flex: none;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    padding: 6px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.flx-panel {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 2.5rem 2rem;
}

#loginComponent,
#formWrapper {
    width: min(480px, 100%);
    background: #fff;
    border: 1px solid var(--fp-border);
    border-radius: 1.25rem;
    box-shadow: 0 24px 56px -28px rgba(2, 32, 71, 0.28);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.card-content {
    padding: 2rem;
}

.card-footer {
    background: #f8fafc;
    border-top: 1px solid var(--fp-border);
    padding: 1.1rem 2rem;
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--fp-muted);
    text-align: center;
}

.flx-panel-head {
    text-align: left;
    margin-bottom: 1.75rem;
}

.flx-panel-head h2 {
    font-size: 1.6rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
}

.flx-panel-head p {
    line-height: 1.6;
    color: var(--fp-muted);
    font-size: 0.95rem;
}

.flx-alert {
    border-radius: var(--fp-radius);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    text-align: center;
}

.flx-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--fp-danger);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.flx-alert-info {
    background: var(--fp-tint);
    border: 1px solid #b3d7ff;
    color: var(--fp-primary-hover);
}

#error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--fp-danger);
    padding: 0.85rem 1rem;
    border-radius: var(--fp-radius);
    margin-bottom: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

.flx-field {
    position: relative;
    margin-bottom: 1.15rem;
}

.flx-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fp-muted);
    letter-spacing: 0.01em;
}

.flx-field input[type="text"],
.flx-field input[type="password"],
.flx-field input[type="email"],
.flx-plain-form input[type="text"],
.flx-plain-form input[type="password"],
.flx-plain-form input[type="email"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--fp-border);
    border-radius: var(--fp-radius);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    background: #fff;
    color: var(--fp-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.flx-field input::placeholder,
.flx-plain-form input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.flx-field input:hover:not(:focus),
.flx-plain-form input:hover:not(:focus) {
    border-color: #94a3b8;
}

.flx-field input:focus,
.flx-plain-form input:focus {
    outline: none;
    border-color: var(--fp-primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.flx-field input:-webkit-autofill,
.flx-field input:-webkit-autofill:hover,
.flx-field input:-webkit-autofill:focus,
.flx-plain-form input:-webkit-autofill,
.flx-plain-form input:-webkit-autofill:hover,
.flx-plain-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px #fff inset;
    -webkit-text-fill-color: var(--fp-ink);
    border-color: var(--fp-primary);
    transition: background-color 9999s ease-out 0s;
}

.flx-field.has-icon input {
    padding-left: 2.75rem;
}

.flx-field-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    color: #94a3b8;
    pointer-events: none;
}

.flx-field.has-label .flx-field-icon {
    top: calc(50% + 0.8rem);
}

.flx-field:has(input:focus) .flx-field-icon {
    color: var(--fp-primary);
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.toggle-password:hover {
    color: var(--fp-ink);
    background: #f1f5f9;
}

.toggle-password svg {
    width: 1.15rem;
    height: 1.15rem;
}

.flx-panel input[type="submit"],
.flx-plain-form input[type="submit"] {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--fp-primary) 0%, var(--fp-primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: var(--fp-radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 18px -8px rgba(0, 102, 204, 0.55);
}

.flx-panel input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -8px rgba(0, 102, 204, 0.6);
}

.flx-panel input[type="submit"]:active {
    transform: translateY(0);
}

.flx-panel input[type="submit"]:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

#passkey-button {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: #fff;
    color: var(--fp-ink);
    border: 1.5px solid var(--fp-border);
    border-radius: var(--fp-radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

#passkey-button svg {
    width: 1.15rem;
    height: 1.15rem;
}

#passkey-button:hover {
    border-color: var(--fp-primary);
    background: #f8fafc;
}

#pRecover {
    text-align: right;
    margin: 0.5rem 0 0.25rem;
}

#pRecover a {
    color: var(--fp-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

#pRecover a:hover {
    color: var(--fp-primary-hover);
    text-decoration: underline;
}

.separator {
    position: relative;
    text-align: center;
    margin: 1.5rem 0 1.25rem;
    font-size: 0.8rem;
    color: var(--fp-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--fp-border);
}

.separator span {
    position: relative;
    background: #fff;
    padding: 0 0.9rem;
}

.back-link {
    text-align: center;
    margin-top: 1.35rem;
}

.back-link a {
    color: var(--fp-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.back-link a:hover {
    text-decoration: underline;
}

.help-text {
    font-size: 0.85rem;
    color: var(--fp-muted);
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.success-message {
    text-align: center;
}

.success-message h3 {
    color: var(--fp-ok);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.success-message h3::before {
    content: '\2713';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #d1fae5;
    color: var(--fp-ok);
    border-radius: 50%;
    font-size: 1rem;
}

.success-message .email {
    color: var(--fp-primary);
    font-weight: 600;
}

.reset-message-primary {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
    color: #334155;
}

.reset-message-secondary {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
    color: var(--fp-muted);
    font-weight: 500;
}

#loadingDiv {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0;
}

#loadingDivBgImg {
    width: 48px;
    height: 48px;
    margin-bottom: 1.25rem;
}

#loadingDivBgImg svg {
    width: 100%;
    height: 100%;
}

#loadingDivBgImg svg circle,
#loadingDivBgImg svg line {
    stroke: var(--fp-primary);
}

.loading-text {
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

.single-otp-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.65rem 0 1.5rem;
}

.single-otp-input {
    width: 100%;
    padding-left: 0.35em;
    height: 72px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    border: 2px solid var(--fp-border);
    border-radius: 14px;
    background: #fff;
    color: var(--fp-ink);
    outline: none;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.single-otp-input::placeholder {
    color: #94a3b8;
    opacity: 1;
    font-weight: 400;
    font-size: 1.8rem;
    letter-spacing: 0.35em;
    font-family: inherit;
}

.single-otp-input:focus {
    border-color: var(--fp-primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.single-otp-input:not(:placeholder-shown) {
    border-color: var(--fp-primary);
    background: var(--fp-tint);
    color: var(--fp-primary-hover);
}

.big-verify-button {
    width: 100%;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, var(--fp-primary) 0%, var(--fp-primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: var(--fp-radius);
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 22px -10px rgba(0, 102, 204, 0.6);
}

.big-verify-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -10px rgba(0, 102, 204, 0.65);
}

.big-verify-button:disabled {
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

.flx-langs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
}

.flx-langs a {
    color: var(--fp-muted);
    text-decoration: none;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
}

.flx-langs a:hover {
    color: var(--fp-primary);
}

.flx-langs a.active {
    color: var(--fp-primary);
    background: var(--fp-tint);
}

.flx-langs .flx-lang-sep {
    color: #cbd5e1;
}

.flx-copyright {
    margin-top: 0.35rem;
    color: var(--fp-muted);
}

.flx-copyright a {
    color: var(--fp-primary);
    text-decoration: none;
}

.dev-warning {
    position: relative;
    background: #fbbf24;
    color: #78350f;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    z-index: 100;
}

.flx-oldbrowser p {
    color: var(--fp-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    text-align: center;
}

.flx-oldbrowser table {
    width: 100%;
}

.flx-oldbrowser table td {
    text-align: center;
    padding: 0.75rem;
}

.flx-oldbrowser table a {
    color: var(--fp-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}

.flx-oldbrowser table img {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
}

input[autocomplete="username"][style*="display: none"] {
    display: none !important;
}

.flx-auth:has(.dev-warning) .flx-shell {
    min-height: calc(100vh - 40px);
}

.flx-auth :is(a, button, input[type="submit"]):focus-visible {
    outline: 3px solid var(--fp-primary);
    outline-offset: 4px;
}

.flx-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    background: var(--fp-tint);
    color: var(--fp-primary);
}

.flx-success-icon svg {
    width: 26px;
    height: 26px;
}

.flx-otp-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.flx-success-icon {
    margin: 0 auto 1.25rem;
    color: var(--fp-ok);
    background: #d1fae5;
}

.flx-success {
    text-align: center;
}

.flx-success h3 {
    margin-bottom: 1rem;
}

.flx-success .email {
    font-weight: 600;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .flx-shell {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    .flx-brand {
        min-height: 270px;
        padding: 2rem max(1.5rem, calc((100vw - 480px) / 2));
    }

    .flx-brand-inner {
        width: auto;
    }

    .flx-brand-logo img {
        width: 190px;
        margin: 0;
    }

    .flx-brand h1,
    .flx-brand .flx-lede,
    .flx-benefits,
    .flx-chip {
        display: none;
    }

    .flx-brand-art {
        object-position: 76% 28%;
    }

        .flx-panel {
        align-items: flex-start;
        margin-top: -3.5rem;
        padding: 0 1rem 2rem;
    }

    #loginComponent,
    #formWrapper {
        max-width: 480px;
    }

    .card-content {
        padding: 2rem;
    }
}

@media (max-width: 400px) {
    .card-content {
        padding: 1.5rem;
    }

    .card-footer {
        padding: 1rem;
    }

    .flx-panel-head h2 {
        font-size: 1.4rem;
        overflow-wrap: anywhere;
    }

    .flx-brand-logo img {
        width: 180px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flx-auth *,
    .flx-auth *::before,
    .flx-auth *::after {
        transition: none !important;
    }
}

body.flx-totp .big-verify-button {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

body.flx-totp .single-otp-input {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 1.6rem;
    font-weight: 600;
}

body.flx-totp .single-otp-input::placeholder {
    font-family: inherit;
    font-size: 1.6rem;
}

@media (min-width: 901px) {
    body.flx-totp .flx-brand h1,
    body.flx-totp .flx-lede {
        max-width: 16rem;
    }
}

body.flx-login .flx-field label {
    color: #334155;
    font-size: 0.85rem;
}

body.flx-login .has-label .toggle-password {
    top: calc(50% + 0.8rem);
}

body.flx-login #pRecover {
    margin: -0.25rem 0 1.25rem;
}

body.flx-login #passkey-button svg {
    flex: none;
}

@media (min-width: 901px) {
    body.flx-login .flx-lede,
    body.flx-login .flx-benefits {
        max-width: 16rem;
    }

    body.flx-login .flx-benefits {
        gap: 1rem;
    }

    body.flx-login .flx-benefits li {
        font-size: 0.85rem;
    }
}

body.flx-login[data-ambience="morning"] .flx-brand::after {
    background: linear-gradient(90deg, rgba(0, 58, 123, 0.9), rgba(0, 61, 126, 0.5) 48%, rgba(0, 39, 88, 0.02)),
        linear-gradient(180deg, rgba(0, 32, 75, 0.15), transparent 60%);
}

body.flx-login[data-ambience="evening"] .flx-brand::after,
body.flx-login[data-ambience="night"] .flx-brand::after {
    background: linear-gradient(90deg, rgba(3, 26, 64, 0.92), rgba(6, 39, 82, 0.55) 48%, rgba(0, 24, 56, 0.06));
}

@media (min-width: 901px) {
    body.flx-login .flx-brand-art {
        object-position: 75% center;
    }
}

.flx-login-dev,
.flx-login-dev label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.flx-login-dev select {
    max-width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1px solid #b7791f;
    border-radius: 6px;
    background: #fff8e6;
    color: #78350f;
    font: inherit;
    letter-spacing: normal;
}

.flx-login-dev select:focus-visible {
    outline: 3px solid var(--fp-primary);
    outline-offset: 2px;
}
