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

body,
html {
    height: 100%;
    font-family: var(--font);
    font-style: normal;
    font-weight: 400;
    font-size: 13px;
    line-height: 20px;
    font-feature-settings: "cv11", "tnum";
    background-color: var(--component-page-background-neutral);
    color: var(--semantic-text-neutral-strong);
    /* just before bg is loaded */
}

/*--------------------- Header Typography ------------------------ */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0px;
}

h3 {
    font-weight: 700;
    font-size: 27px;
    line-height: 40px;
}

/*--------------------- Container ------------------------ */
.container-login {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.fade-in {
    animation: bgFade 4s 0s forwards;
}
.fade-in-delayed {
    animation: bgFade 5s 2s forwards;
}
@keyframes bgFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.container-login-bg {
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0;
}

/* Banner */
.container-wrap-banner {
    display: none;
    width: 500px;
    padding: 16px;
    margin-bottom: 24px;
    flex-direction: column;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid var(--component-banner-border);
    background: var(--component-banner-background);
    z-index: 1;
    flex-shrink: 0;
}

.wrap-banner {
    align-self: stretch;
    color: var(--component-banner-label);
    font-size: 13px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
}

.wrap-login {
    display: block;
    width: 500px;
    overflow: hidden;
    padding: 32px 48px;
    border-radius: 16px;
    border: 1px solid var(--component-card-subtle-border);
    background: var(--component-card-subtle-background);
    z-index: 2;
}

.wrap-login.hidden {
    display: none !important;
}

.system {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    align-self: stretch;
}

.container-login-forms {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 12px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form.--sso {
    display: none;
}

.container-forgot-remember {
    display: flex;
    /* TODO @saso once forgot password flow active: change padding-top back to 4px */
    padding: 12px 0 0 0;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
}

.container-forgot {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    align-self: stretch;
}

.container-remember {
    display: flex;
    position: relative;
}

.container-sms {
    display: none;
    flex-direction: column;
    align-items: center;
}

.container-sms-hint {
    text-align: center;
    font-size: 12px;
    padding-top: 4px;
}

.validate-input {
    position: relative;
}

.container-challenge {
    display: none;
}

.number-challenge-div {
    text-align: center;
    font-size: 15px;
    margin: 10px;
}

.number-challenge-number-div {
    text-align: center;
    font-size: 30px;
    margin: 10px;
}

.container-warning {
    display: none;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.container-error,
.container-success {
    display: none;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 4px 8px;
}

.wrap-input {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wrap-input.none {
    display: none;
}

.wrap-input.block {
    display: block;
}

.help {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    align-self: stretch;
    font-size: 11px;
    line-height: 16px;
}

.help-desc {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 280px;
    align-items: center;
}

/*--------------------- Header & Logo ------------------------ */
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-height: 120px;
    margin: 20px 0;
}

.img-logo {
    height: 80px;
    width: 100%;
    object-fit: contain;
}

.login-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-title h3 {
    text-align: center;
}

.login-title-desc {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.login-title-desc p {
    color: var(--semantic-text-neutral-moderate);
    text-align: center;
}

/*--------------------- Input fields ------------------------ */
.label {
    font-weight: 700;
}

.input {
    font: var(--font);
    color: var(--component-form-neutral-enabled-label);
    width: 100%;
    height: 36px;
    padding: 8px 4px 8px 8px;
    border-radius: 4px;
    border: 1px solid var(--component-form-neutral-enabled-border);
    background: var(--component-form-neutral-enabled-surface);
    transition: background-color 0.2s ease-in-out;
}

.input.error {
    color: var(--component-form-critical-enabled-label);
    border: 1px solid var(--component-form-critical-enabled-border);
    background: var(--component-form-critical-enabled-surface);
}

.input.password {
    padding-right: 32px;
}

/* fix password bullets' size in firefox */
@-moz-document url-prefix() {
    input[type="password"]:not(:placeholder-shown) {
        font: initial;
    }
}

.input:hover {
    border-color: var(--component-form-neutral-hovered-border);
    background: var(--component-form-neutral-hovered-surface);
}

.input.error:hover {
    border-color: var(--component-form-critical-hovered-border);
    background: var(--component-form-critical-hovered-surface);
}

.input:focus {
    padding-left: 8px;
    border-color: var(--component-form-neutral-active-border);
    background: var(--component-form-neutral-active-surface);
}

.input.error:focus {
    border-color: var(--component-form-critical-active-border);
    background: var(--component-form-critical-active-surface);
}

textarea:focus,
input:focus {
    outline: none !important;
}

input:focus::placeholder {
    color: transparent;
}

textarea:focus::placeholder {
    color: transparent;
}

input::placeholder {
    color: var(--component-form-neutral-enabled-placeholder);
}

textarea::placeholder {
    color: var(--component-form-neutral-enabled-placeholder);
}

.focus {
    position: relative;
    width: 100%;
}

.focus.--small,
.focus.--checkbox,
.focus.--help-text {
    width: auto;
}

.focus:focus-within::after {
    content: "";
    position: absolute;
    border: 2px solid var(--component-icon-neutral-strong);
    border-radius: 6px;
    pointer-events: none;
}

.focus:focus-within::after {
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
}

.focus.--small:focus-within::after {
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
}

.focus.--checkbox:focus-within::after {
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
}

.focus.--help-text:focus-within::after {
    top: 1px;
    left: 0px;
    right: 0px;
    bottom: 1px;
}

input[type="checkbox"] {
    appearance: none;
    opacity: 0;
}

input[type="checkbox"] + label {
    position: relative;
    padding-left: 26px;
    min-height: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

input[type="checkbox"] + label::before {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 1px;
    box-shadow: inset 0 0 0 1px
        var(--component-form-control-inactive-enabled-control-border);
    background-color: var(
        --component-form-control-inactive-enabled-control-surface
    );
    transition: all 0.2s ease-in-out;
}

input[type="checkbox"]:hover + label::before {
    border-color: var(--component-form-control-inactive-hovered-control-border);
    background-color: var(
        --component-form-control-inactive-hovered-control-surface
    );
}

input[type="checkbox"]:checked + label::before {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 1px;
    box-shadow: inset 0 0 0 1px
        var(--component-form-control-active-enabled-control-border);
    background-color: var(--primary);
}

input[type="checkbox"]:checked + label::after {
    content: "";
    display: block;
    position: absolute;
    left: 1.4%;
    width: 15px;
    height: 15px;
    border-radius: 1px;
    background-color: var(
        --component-form-control-active-enabled-indicator-surface
    );
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M5 13L9 17L19 7"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M5 13L9 17L19 7"/></svg>');
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
}

input[type="checkbox"]:checked:hover + label::before {
    border-color: var(--component-form-control-active-hovered-control-border);
    background: var(--component-form-control-active-hovered-control-surface);
}

input[type="checkbox"]:checked:hover + label::after {
    background-color: var(
        --component-form-control-active-hovered-indicator-surface
    );
}

/*--------------------- Buttons ------------------------ */
button {
    outline: none !important;
    border: none;
    background: transparent;
}

.button-ghost {
    display: flex;
    padding: 2px 4px;
    font: var(--font);
    color: var(--secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.button-ghost:hover {
    background-color: var(--component-button-ghost-hovered-surface);
}

.button-ghost:active {
    background-color: var(--component-button-ghost-active-surface);
}

.button-accent {
    font-family: var(--font);
    font-size: 13px;
    color: var(--component-button-accent-enabled-text);
    line-height: 20px;

    display: flex;
    justify-content: center;
    align-items: center;
    height: 36px;
    min-width: 120px;
    flex: 1;
    padding: 0 4px;
    border-radius: 4px;
    border: 1px solid var(--component-button-accent-enabled-border);
    background: var(--primary);
    text-decoration: none;

    position: relative;
    z-index: 1;

    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.button-accent:disabled {
    background-color: var(--component-button-accent-disabled-surface);
    color: var(--component-button-accent-disabled-text);
    border-color: var(--component-button-accent-disabled-border);
    cursor: not-allowed;
}

.button-neutral {
    font-family: var(--font);
    font-size: 13px;
    color: var(--component-button-neutral-enabled-text);
    line-height: 20px;

    display: flex;
    justify-content: center;
    align-items: center;
    height: 36px;
    min-width: 120px;
    flex: 1;
    padding: 0 4px;
    border-radius: 4px;
    border: 1px solid var(--component-button-neutral-enabled-border);
    background: var(--component-button-neutral-enabled-surface);
    text-decoration: none;

    position: relative;
    z-index: 1;

    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.button-neutral:disabled {
    background-color: var(--component-button-neutral-disabled-surface);
    color: var(--component-button-neutral-disabled-text);
    border-color: var(--component-button-neutral-disabled-border);
    cursor: not-allowed;
}

.button-accent.code {
    display: none;
}

.button-accent.sms {
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
}

.button-accent.push {
    display: none;
}

/* TODO @saso: delete :not(.login-form-btn) part after whitelabelling fix */
.button-accent:not(.login-form-btn):hover:not(:disabled) {
    color: var(--component-button-accent-hovered-text);
    border-color: var(--component-button-accent-hovered-border);
    /* bg-color set in customize.js */
}

.button-neutral:hover:not(:disabled) {
    color: var(--component-button-neutral-hovered-text);
    border-color: var(--component-button-neutral-hovered-border);
    background-color: var(
        --component-button-neutral-hovered-surface
    ) !important;
}

.button-accent:active:not(:disabled) {
    color: var(--component-button-accent-pressed-text);
    border-color: var(--component-button-accent-pressed-border);
    background-color: var(--component-button-accent-pressed-surface);
}

.button-neutral:active:not(:disabled) {
    color: var(--component-button-neutral-pressed-text);
    border-color: var(--component-button-neutral-pressed-border);
    background-color: var(--component-button-neutral-pressed-surface);
}

.wrap-input .button-icon {
    color: var(--component-button-ghost-enabled-icon);
    stroke: var(--component-button-ghost-enabled-icon);
    position: absolute;
    height: 24px;
    right: 8px;
    top: 50%;
    cursor: pointer;
    border-radius: 4px;
    transition:
        background-color 0.2s ease-in-out,
        stroke 0.2s ease-in-out,
        color 0.2s ease-in-out;
    padding: 2px;
}

.button-icon:hover {
    color: var(--component-button-ghost-hovered-icon);
    stroke: var(--component-button-ghost-hovered-icon);
    background-color: var(--component-button-ghost-hovered-surface);
}

.button-icon:active {
    color: var(--component-button-ghost-pressed-icon);
    stroke: var(--component-button-ghost-pressed-icon);
    background-color: var(--component-button-ghost-pressed-surface);
}

.icon-eye-open {
    display: none;
}

#togglePassword.is-visible .icon-eye-open {
    display: inline;
}

#togglePassword.is-visible .icon-eye-closed {
    display: none;
}

/*--------------------- Links ------------------------ */

.help-text a {
    display: block;
}

a {
    font-family: var(--font);
    font-size: 11px;
    color: var(--secondary);
    padding: 4px 4px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

a:not(.button-accent):not(.button-neutral):hover {
    background-color: var(--component-button-ghost-hovered-surface);
}

a:not(.button-accent):not(.button-neutral):active {
    background-color: var(--component-button-ghost-pressed-surface);
}

a:not(.button-accent):not(.button-neutral):focus {
    outline: none !important;
}

button a {
    font-family: unset;
    font-size: unset;
    color: unset;
    padding: unset;
    border-radius: unset;
    transition: unset;
    text-decoration: none;
}

button a:hover {
    background-color: unset;
}

button a:active {
    background-color: unset;
}

/*--------------------- Divider (only shown with SSO) ------------------------ */
.container-divider {
    display: none;
    align-items: center;
    gap: 8px;
}

.divider {
    height: 1px;
    flex: 1;
    background-color: var(--component-divider-subtle);
}

.divider-label {
    font-size: 11px;
    line-height: 16px;
    color: var(--semantic-text-neutral-moderate);
}

/*--------------------- Errors, Alerts, Warnings ------------------------ */
.alert,
.warning {
    color: var(--component-form-critical-hint);
    font-size: 11px;
    line-height: 16px;
}

.alert {
    text-align: left;
    width: auto;
}

.warning-icon {
    color: var(--component-form-warning-enabled-icon);
    stroke: var(--component-form-warning-enabled-icon);
}

.critical-icon {
    flex-shrink: 0;
    color: var(--component-form-critical-enabled-icon);
    stroke: var(--component-form-critical-enabled-icon);
}

#emailError,
#passwordRequired,
#rejectedCode {
    justify-content: left;
}

/*--------------------- Ellipsis styles ------------------------ */
.blurred-ellipsis-wrapper {
    position: absolute;
    width: 1200px;
    height: 100%;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%);
    transition: top 5s ease-in-out;
}

.blurred-ellipsis {
    position: absolute;
    z-index: 1;
    overflow: visible;
    mix-blend-mode: var(--ellipse-blend-mode);
    transform-origin: 50% 50%;
}

.blurred-ellipsis.yellow {
    top: 275px;
    left: 165px;
    animation: orbitYellow 5s linear infinite;
}

.blurred-ellipsis.green {
    top: 200px;
    left: 25px;
    animation: orbitGreen 10s linear infinite;
}

.blurred-ellipsis.blue {
    top: 0;
    left: 0;
    animation: orbitBlue 25s linear infinite;
}

@keyframes orbitYellow {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(50px) translateY(-30px) rotate(90deg);
    }
    50% {
        transform: translateX(0) translateY(-60px) rotate(180deg);
    }
    75% {
        transform: translateX(-50px) translateY(-30px) rotate(270deg);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(360deg);
    }
}

@keyframes orbitGreen {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(80px) translateY(40px) rotate(90deg);
    }
    50% {
        transform: translateX(0) translateY(80px) rotate(180deg);
    }
    75% {
        transform: translateX(-80px) translateY(40px) rotate(270deg);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(360deg);
    }
}

@keyframes orbitBlue {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(100px) translateY(50px) rotate(90deg);
    }
    50% {
        transform: translateX(0) translateY(100px) rotate(180deg);
    }
    75% {
        transform: translateX(-100px) translateY(50px) rotate(270deg);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(360deg);
    }
}

/*--------------------- Responsiveness ------------------------ */

/* Touch (Phone and Tablet base) */
@media (max-width: 1199px) {
    body,
    html {
        font-size: 16px;
        line-height: 20px;
    }

    .container-login {
        justify-content: flex-start;
        padding: 40px 24px;
        min-height: 100vh;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .blurred-ellipsis-wrapper {
        width: 800px;
        left: 120%;
        top: 0%;
    }

    .container-wrap-banner {
        flex-shrink: 0;
        width: 100%;
    }

    .wrap-login {
        width: 100%;
        flex: 1;
        min-height: 0;
        padding: 0px;
        border: none;
        background: none;
        overflow: visible;
        display: flex !important;
        flex-direction: column;
    }

    .wrap-banner {
        font-size: 16px;
    }

    .system {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .header {
        flex: 1;
        min-height: 0;
        justify-content: flex-end;
    }

    .wrap-input {
        gap: 8px;
    }

    .container-login-forms {
        gap: 16px;
    }

    .login-form {
        gap: 16px;
    }

    .input {
        height: 48px;
        padding: 8px 16px;
    }

    .input:focus {
        padding-left: 16px;
    }

    .input.password {
        padding-right: 48px;
    }

    .container-forgot-remember {
        gap: 8px;
        /* TODO @saso once forgot password flow active: remove padding-top */
        padding-top: 16px;
    }

    .wrap-input .button-icon {
        right: 16px;
        top: 53% !important;
    }

    [type="checkbox"]:checked + label::after {
        left: 1.5px;
    }

    .button-accent,
    .button-neutral {
        font-size: 16px;
        height: 48px;
    }

    .divider-label {
        font-size: 14px;
    }

    .help {
        font-size: 14px;
    }

    .help-desc {
        max-width: none;
    }

    a {
        font-size: 14px;
    }

    .container-error .critical-icon {
        margin-top: 1px;
    }

    .alert,
    .warning {
        font-size: 13px;
        line-height: 19px;
    }
}

/* Short Phone */
@media (max-width: 599px) and (max-height: 770px) {
    .container-login {
        min-height: 100vh;
        height: auto;
    }
}

/* Tablet & Landscape Phone: card look */
@media (min-width: 600px) {
    .container-login {
        padding: 80px 15px;
        height: auto;
        justify-content: flex-start;
    }

    .blurred-ellipsis-wrapper {
        width: 1200px;
        top: 30%;
        left: 50%;
    }

    .container-wrap-banner {
        width: 500px;
    }

    .wrap-login {
        width: 500px;
        overflow: visible;
        padding: 32px 48px;
        flex: 0;
        border-radius: 16px;
        border: 1px solid var(--component-card-subtle-border);
        background: var(--component-card-subtle-background);
        z-index: 2;
    }
}

/* Desktop */
@media (min-width: 1200px) {
    .container-login {
        justify-content: center;
        align-items: center;
        padding: 15px;
    }
}

/* High desktop */
@media (min-height: 1081px) {
    .blurred-ellipsis-wrapper {
        top: 50%;
    }
}
