/* ================================================================== >> Basic << */

/* ------------------------------------------------------- >> Reset << */
*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

* {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    text-decoration: none;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background-color: #3B3B40;
}

button,
input {
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}

button,
.operator,
.form-button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

img,
svg {
    display: block;
    max-width: 100%;
}

/* -------------------------------------------- >> scroll style << */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0);
}

html,
body {
    scrollbar-width: none;
}

/* ---------------------------------------------------- >> font << */
@font-face {
    font-family: "vazir";
    src: url("../fonts/Vazir-Medium-FD.662b4bbae810.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "vazirB";
    src: url("../fonts/Vazir-Bold-FD.5d949700eb21.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "BYekan";
    src: url("../fonts/BYekan+.080f937ceb58.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------------------------------------------------- >> root << */
:root {
    --white: #E6E6FA;
    --white75: #e6e6fac5;
    --white50: #e6e6fa85;
    --white25: #e6e6fa48;
    --black: #3B3B40;
    --black75: #3b3b40c9;
    --black50: #3b3b4086;
    --black25: #3b3b403d;
    --gray: #66666E;
    --gray75: #66666ecc;
    --gray50: #66666e88;
    --gray25: #66666e52;
    --green: #39962D;
    --green75: #39962dcb;
    --green50: #39962d86;
    --green25: #39962d49;
    --yellow: #FFE829;
    --orange: #E49B0F;
    --deep-red: #7D1A16;
    --deep-red75: #7d1916b9;
    --deep-red50: #7d19168c;
    --deep-red25: #7d191642;

    --border-radius: 0.75rem;
    --page-gap: 1rem;
    --form-gap: 1rem;
    --title-f-size: 1.5rem;
    --label-text-f-size: 1.2rem;
}

/* ---------------------------------------------- >> All Father << */
html,
body {
    width: 100%;
    min-width: 100%;
    min-height: 100%;
    position: relative;
    font-family: "vazir", Arial, sans-serif;
    background-color: var(--black);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ================================================================== >> Basic << */

/* ================================================================ >> Layer 1 << */
.Layer1 {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
}

/* -------------------------------------------------- >> Body << */
#BG_1 {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--page-gap);
    padding-top: max(var(--page-gap), env(safe-area-inset-top));
    padding-right: max(var(--page-gap), env(safe-area-inset-right));
    padding-bottom: max(var(--page-gap), env(safe-area-inset-bottom));
    padding-left: max(var(--page-gap), env(safe-area-inset-left));
}

/* ----------------------------------------------- >> content << */
.content {
    width: 100%;
    min-width: 0;
    height: calc(100vh - (var(--page-gap) * 2));
    height: calc(100dvh - (var(--page-gap) * 2));
    min-height: 24rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 0.2rem solid var(--white);
    background: linear-gradient(45deg, var(--green), var(--orange));
    background-size: 800% 100%;
    background-position: 0% 0%;
    display: flex;
    flex-direction: row-reverse;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.5);
    transform-origin: center center;
    transition:
        opacity 0.5s ease,
        transform 0.5s ease,
        background-position 0.5s ease;
    will-change: opacity, transform, background-position;
}

.content.show {
    transform: scale(1);
    opacity: 1;
}

.content.change {
    background-position: 100% 0%;
}

/* ------------------------------------------------- >> forms << */
.forms-wrapper {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    height: 100%;
    scroll-behavior: smooth;
    overflow: hidden;
    position: relative;
}

.form-container {
    width: calc(100% - 2rem);
    max-width: 46rem;
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    gap: var(--form-gap);
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0) scale(0);
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
    transform-origin: center center;
    z-index: 0;
    pointer-events: none;
}

.form-container.show {
    opacity: 1;
    transform: translate(-50%, -50%) scaleY(1) scale(1);
    pointer-events: auto;
}

.form-title {
    font-size: var(--title-f-size);
    color: var(--white);
    font-family: "vazirB", "vazir", Arial, sans-serif;
    line-height: 1.5;
    text-align: center;
}

/* ------------------------------------ > Field < */
.form-label {
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.form-label-text {
    color: var(--white75);
    font-size: var(--label-text-f-size);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.form-label-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    fill: var(--white);
}

.form-input {
    width: 100%;
    min-width: 0;
    min-height: 3.5rem;
    height: 4rem;
    border: 0.2rem solid var(--white50);
    background-color: var(--black);
    outline: none;
    padding: 0.5rem 1rem;
    text-align: right;
    border-radius: var(--border-radius);
    font-family: "vazir", Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.5;
    caret-color: var(--white);
    color: var(--white);
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.form-input:focus,
.form-input:focus-visible {
    border-color: var(--white);
}

.form-input.error {
    background-color: var(--deep-red);
    border-color: var(--deep-red);
}

.form-input::placeholder {
    color: var(--white50);
    font-size: 1rem;
    opacity: 1;
}

#login-form-input,
#signup-phone-number,
#OTP-input {
    text-align: center;
    direction: ltr;
}

#OTP_Back {
    margin-left: auto;
}

/* ----------------------------------- > button < */
.flex-container {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
}

.form-button {
    cursor: pointer;
    width: max-content;
    max-width: 100%;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border: 0.2rem solid var(--white50);
    background-color: var(--black);
    transition: border-color 0.25s ease, transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .form-button:hover {
        border-color: var(--white);
    }
}

.form-button:focus-visible {
    outline: 0.15rem solid var(--white);
    outline-offset: 0.15rem;
}

.form-button:active {
    transform: scale(0.95);
    border-color: var(--white);
}

.form-button-text {
    font-size: clamp(0.9rem, 1vw, 1.5rem);
    line-height: 1.5;
    color: var(--white75);
    font-family: "vazir", Arial, sans-serif;
    white-space: normal;
    overflow-wrap: anywhere;
}

.form-button-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
}

#SignupSubmit {
    margin-right: auto;
}

/* --------------------------------- > operator < */
.operator {
    width: max-content;
    max-width: 100%;
    min-height: 2.75rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    color: var(--black75);
    fill: var(--black75);
    transition: color 0.25s ease, fill 0.25s ease, opacity 0.25s ease;
    font-family: "vazir", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    .operator:hover {
        color: var(--white);
        fill: var(--white);
    }
}

.operator:focus-visible {
    outline: 0.15rem solid var(--white);
    outline-offset: 0.1rem;
    border-radius: 0.5rem;
}

.operator:disabled,
.form-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.operator-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
}

.operator-text {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ------------------------------------------------ >> Vector << */
.vector-wrapper {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    height: 100%;
    position: relative;
    padding: clamp(1rem, 2vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vector-contianer {
    width: min(90%, 42rem);
    max-height: 90%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: var(--black);
    border: 0.2rem solid var(--white);
    transform: rotate(360deg) scale(0.5);
    transform-style: preserve-3d;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.vector-contianer.show {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.vector {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg) scale(0);
    z-index: 1;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.vector.show {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* ================================================================ >> Layer 2 << */
.Layer2 {
    z-index: 3;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    transition: transform 0.5s ease;
    position: fixed;
    inset: 0;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--white);
}

.Layer2.remove {
    transform: translateY(100%);
    pointer-events: none;
}

#BG_2 {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.loading-text {
    max-width: min(90vw, 60rem);
    padding: 0 0.5rem;
    font-size: clamp(1.4rem, 2.5vw, 4rem);
    font-family: "vazir", Arial, sans-serif;
    line-height: 1.6;
    text-align: center;
    transition: transform 0.5s ease, opacity 0.5s ease;
    transform: scale(1);
    opacity: 1;
    overflow-wrap: anywhere;
}

.loading-text.change {
    transform: scale(0.5);
    opacity: 0;
}

.loading {
    position: absolute;
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-circle {
    width: 1rem;
    height: 1rem;
    background-color: var(--white50);
    transition: transform 0.5s ease, background-color 0.5s ease;
    border-radius: 50%;
    transform: scale(0.8);
}

.loading-circle.active {
    transform: scale(1.5);
    background-color: var(--white);
}

/* ============================================================ >> Media Query << */

/* ------------------------------------------------ >> 4K << */
@media screen and (min-width: 2000px) {
    :root {
        --form-gap: 1.4rem;
        --title-f-size: 3rem;
        --label-text-f-size: 2rem;
    }

    .form-input {
        min-height: 5rem;
        height: 6rem;
        font-size: 2rem;
    }

    .form-input::placeholder {
        font-size: 1.5rem;
    }

    .form-label-icon,
    .form-button-icon,
    .operator-icon {
        width: 2rem;
        height: 2rem;
    }

    .form-button {
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .form-button-text {
        font-size: 1.8rem;
    }

    .operator {
        padding: 1.2rem;
        font-size: 1.5rem;
    }
}

/* ------------------------------------------ >> S Laptop << */
@media screen and (max-width: 1024px) {
    :root {
        --page-gap: 0.75rem;
    }

    .content {
        padding: 0.75rem;
    }

    .form-container {
        width: calc(100% - 1rem);
    }

    .vector-wrapper {
        padding: 1rem;
    }
}

/* -------------------------------------------- >> Tablet << */
@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: auto;
    }

    .Layer1,
    #BG_1 {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    #BG_1 {
        justify-content: flex-start;
    }

    .content {
        height: calc(100vh - (var(--page-gap) * 2));
        height: calc(100dvh - (var(--page-gap) * 2));
        min-height: 40rem;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background: linear-gradient(to bottom, var(--green), var(--orange));
        background-size: 100% 800%;
        background-position: 0% 0%;
        padding: 0.75rem;
        overflow: visible;
    }

    .content.change {
        background-position: 0% 100%;
    }

    .vector-wrapper {
        flex: 1 1 42%;
        width: 100%;
        height: auto;
        min-height: 14rem;
    }

    .vector-contianer {
        width: min(55vw, 19rem);
        max-height: 100%;
    }

    .forms-wrapper {
        flex: 1 1 58%;
        width: min(100%, 38rem);
        height: auto;
        min-height: 24rem;
        overflow: hidden;
    }

    .form-container {
        width: 100%;
        max-width: 34rem;
        height: 100%;
        padding: 0.25rem;
        justify-content: flex-start;
    }
}

/* ------------------------------------------ >> Mobile << */
@media screen and (max-width: 480px) {
    :root {
        --page-gap: 0.5rem;
        --form-gap: 0.75rem;
        --title-f-size: 1.35rem;
        --label-text-f-size: 1rem;
    }

    .content {
        padding: 0.5rem;
        border-width: 0.15rem;
    }

    .vector-wrapper {
        flex: 1 1 50%;
        height: auto;
        min-height: 12rem;
        padding: 0.5rem;
    }

    .vector-contianer {
        width: min(72vw, 20rem);
    }

    .forms-wrapper {
        flex: 1 1 60%;
        width: 100%;
        height: auto;
        min-height: 23rem;
    }

    .form-container {
        padding: 0.25rem 0.4rem 0.75rem;
    }

    .form-input {
        min-height: 3.25rem;
        height: 3.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        border-width: 0.15rem;
    }

    .form-input::placeholder {
        font-size: 0.9rem;
    }

    .form-button {
        min-height: 2.8rem;
        padding: 0.55rem 0.85rem;
        border-width: 0.15rem;
    }

    .operator {
        width: 100%;
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }

    .loading-text {
        font-size: clamp(1.2rem, 6vw, 1.8rem);
    }
}

/* ------------------------------------------ >> S mobile << */
@media screen and (max-width: 360px) {
    :root {
        --form-gap: 0.6rem;
    }

    .vector-wrapper {
        height: auto;
        min-height: 11.5rem;
    }

    .vector-contianer {
        width: min(76vw, 14rem);
    }

    .forms-wrapper {
        height: auto;
        min-height: 24rem;
    }

    .form-container {
        padding-inline: 0.15rem;
    }

    .form-label-text {
        font-size: 0.95rem;
    }

    .form-input {
        min-height: 3rem;
        height: 3.2rem;
    }
}

/* ----------------------------- >> Short / landscape displays << */
@media screen and (max-height: 620px) and (min-width: 769px) {
    :root {
        --form-gap: 0.5rem;
    }

    .content {
        min-height: 0;
        padding: 0.5rem;
    }

    .vector-wrapper {
        padding: 0.5rem;
    }

    .vector-contianer {
        width: min(70%, 22rem);
        max-height: 88%;
    }

    .form-container {
        width: calc(100% - 1rem);
    }

    .form-title {
        font-size: 1.2rem;
    }

    .form-label-text {
        font-size: 1rem;
    }

    .form-input {
        min-height: 2.8rem;
        height: 3rem;
        font-size: 1rem;
    }

    .operator,
    .form-button {
        min-height: 2.4rem;
        padding-block: 0.35rem;
    }
}

@media screen and (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
    body {
        overflow: auto;
    }

    #BG_1 {
        min-height: 32rem;
    }

    .content {
        min-height: 30rem;
    }
}

/* --------------------------------------- >> Accessibility << */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ============================================================ >> Media Query << */
