:root {
    --accent: #1473e6;
    --accent-dark: #0d5dbd;
    --danger: #c4342d;
    --ink: #090b0f;
    --muted: #667085;
    --paper: #ffffff;
    --success: #147a63;
    color-scheme: light;
}

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

html {
    min-width: 320px;
    background: #0b1724;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
    color: var(--ink);
    background-color: #0b1724;
    font-family: 'SolaimanLipi', 'Noto Sans Bengali', 'Hind Siliguri', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.auth-page {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    padding: 32px clamp(24px, 7vw, 132px);
    background-image: url('./images/study-bg.png');
    background-position: center;
    background-size: cover;
}

.auth-page__overlay {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 14, 23, 0.34) 0%, rgba(5, 14, 23, 0.16) 48%, rgba(5, 14, 23, 0.2) 100%),
        linear-gradient(180deg, rgba(5, 14, 23, 0.06), rgba(5, 14, 23, 0.28));
    backdrop-filter: saturate(0.92);
}

.wrapper {
    --auth-shape-ease: cubic-bezier(0.76, 0, 0.24, 1);
    --auth-exit-ease: cubic-bezier(0.4, 0, 1, 1);
    --auth-enter-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --auth-visibility-delay: 1450ms;
    position: relative;
    width: min(880px, 100%);
    height: 590px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    box-shadow:
        0 34px 80px rgba(2, 9, 17, 0.38),
        0 8px 24px rgba(2, 9, 17, 0.2),
        inset 0 0 0 1px rgba(9, 11, 15, 0.08);
}

.wrapper::after {
    position: absolute;
    z-index: 10;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: inherit;
    content: '';
    pointer-events: none;
}

.rotate-bg,
.rotate-bg2 {
    position: absolute;
    backface-visibility: hidden;
    contain: paint;
    pointer-events: none;
}

.rotate-bg {
    z-index: 1;
    top: -4px;
    right: 0;
    width: 113.333%;
    height: 133.333%;
    background:
        radial-gradient(circle at 78% 24%, rgba(20, 115, 230, 0.23), transparent 25%),
        linear-gradient(145deg, #151a22 0%, #050608 72%);
    transform: rotate(10deg) skewY(40deg) translateZ(0);
    transform-origin: bottom right;
    transition: transform 1500ms ease 1600ms;
}

.rotate-bg2 {
    z-index: 2;
    top: 100%;
    left: 33.333%;
    width: 113.333%;
    height: 155.556%;
    background: var(--paper);
    transform: rotate(0deg) skewY(0deg) translateZ(0);
    transform-origin: bottom left;
    transition: transform 1500ms ease 500ms;
}

.wrapper.is-signup-active .rotate-bg {
    transform: rotate(0deg) skewY(0deg) translateZ(0);
    transition-delay: 500ms;
}

.wrapper.is-signup-active .rotate-bg2 {
    transform: rotate(-11deg) skewY(-45deg) translateZ(0);
    transition-delay: 1200ms;
}

.wrapper.is-transitioning .rotate-bg,
.wrapper.is-transitioning .rotate-bg2 {
    will-change: transform;
}

.wrapper.is-transitioning [data-auth-switch] {
    pointer-events: none;
}

.form-box {
    position: absolute;
    z-index: 5;
    top: 0;
    display: flex;
    align-items: center;
    width: 50%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    transition: visibility 0s linear 0s;
}

.form-box::-webkit-scrollbar {
    display: none;
}

.form-box.login {
    left: 0;
    padding: 48px 66px 46px 48px;
    visibility: visible;
}

.form-box.signup {
    right: 0;
    padding: 34px 46px 30px 68px;
    visibility: hidden;
    transition-delay: var(--auth-visibility-delay);
}

.wrapper.is-signup-active .form-box.login {
    visibility: hidden;
    pointer-events: none;
    transition-delay: var(--auth-visibility-delay);
}

.wrapper.is-signup-active .form-box.signup {
    visibility: visible;
    transition-delay: 0s;
}

.form-content {
    width: 100%;
    margin-block: auto;
}

.panel-heading {
    margin-bottom: 25px;
}

.panel-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--accent-dark);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0;
}

.panel-heading h1 {
    position: relative;
    padding-bottom: 13px;
    font-size: clamp(1.78rem, 2.4vw, 2.15rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
}

.panel-heading h1::after {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 44px;
    height: 4px;
    border-radius: 99px;
    background: var(--accent);
    content: '';
}

.panel-heading p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.form-box.signup .panel-heading {
    margin-bottom: 18px;
}

.form-box.signup .panel-heading p {
    margin-top: 9px;
}

.has-google-auth .panel-heading {
    margin-bottom: 16px;
}

.has-google-auth .form-box.signup .panel-heading {
    margin-bottom: 12px;
}

.google-auth {
    display: grid;
    gap: 9px;
    width: 100%;
    margin-bottom: 13px;
}

.google-auth__button {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    overflow: hidden;
    border-radius: 999px;
}

.google-auth__button > div,
.google-auth__button iframe {
    max-width: 100% !important;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #7a8494;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
    flex: 1;
    height: 1px;
    background: #d8dee8;
    content: '';
}

.google-auth__status {
    padding: 8px 10px;
    color: #8d241e;
    background: #fff0ee;
    border: 1px solid #fac8c4;
    border-radius: 9px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
}

.google-auth__status[hidden] {
    display: none;
}

.wrapper.is-google-authenticating .google-auth__button {
    opacity: 0.62;
    pointer-events: none;
}

.wrapper.is-transitioning .google-auth__button {
    pointer-events: none;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-box.signup .auth-form {
    gap: 13px;
}

.has-google-auth .auth-form {
    gap: 13px;
}

.has-google-auth .form-box.signup {
    padding-block: 26px 28px;
}

.has-google-auth .form-box.signup .auth-form {
    gap: 9px;
}

.has-google-auth .form-box.signup .input-box {
    height: 48px;
}

.field-group {
    display: grid;
    gap: 6px;
}

.input-box {
    position: relative;
    height: 52px;
}

.input-box input {
    width: 100%;
    height: 100%;
    padding: 17px 36px 5px 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 2px solid #1a2029;
    border-radius: 0;
    outline: 0;
    font-size: 0.95rem;
    font-weight: 600;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.input-box label {
    position: absolute;
    top: 50%;
    left: 0;
    max-width: calc(100% - 38px);
    overflow: hidden;
    color: #343b45;
    font-size: 0.92rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left center;
    transition: color 0.22s ease, top 0.22s ease, transform 0.22s ease;
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 2px;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #202630;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    pointer-events: none;
    transform: translateY(-50%);
    transition: stroke 0.22s ease, transform 0.22s ease;
}

.input-box input:focus,
.input-box input:not(:placeholder-shown) {
    border-bottom-color: var(--accent);
}

.input-box input:focus {
    box-shadow: 0 2px 0 rgba(20, 115, 230, 0.12);
}

.input-box input:focus + label,
.input-box input:not(:placeholder-shown) + label {
    top: 4px;
    color: var(--accent-dark);
    transform: translateY(0) scale(0.77);
}

.input-box input:focus ~ .input-icon,
.input-box input:not(:placeholder-shown) ~ .input-icon {
    stroke: var(--accent);
    transform: translateY(-50%) scale(1.04);
}

.input-box input.is-invalid {
    border-bottom-color: var(--danger);
}

.input-box input.is-invalid + label,
.input-box input.is-invalid ~ .input-icon {
    color: var(--danger);
    stroke: var(--danger);
}

.field-error {
    color: var(--danger);
    font-size: 0.73rem;
    font-weight: 600;
    line-height: 1.45;
}

.remember-field {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 9px;
    color: #475467;
    font-size: 0.83rem;
    cursor: pointer;
    user-select: none;
}

.remember-field input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 22px;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 9px 22px rgba(20, 115, 230, 0.25);
    outline: 0;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.auth-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 0.22s ease;
}

.auth-button:hover {
    background: var(--accent-dark);
    box-shadow: 0 12px 27px rgba(20, 115, 230, 0.34);
    transform: translateY(-2px);
}

.auth-button:hover svg {
    transform: translateX(3px);
}

.auth-button:active {
    transform: translateY(0) scale(0.985);
}

.auth-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.switch-copy {
    color: #596273;
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}

.switch-copy a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
    text-underline-offset: 3px;
}

.switch-copy a:hover {
    text-decoration: underline;
}

.forgot-password-link {
    border: 0;
    background: transparent;
    color: var(--accent-dark);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}

.forgot-password-link:hover,
.forgot-password-link:focus {
    text-decoration: underline;
}

.auth-alert {
    margin: -7px 0 15px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
}

.auth-alert--success {
    color: #105948;
    background: #e9f8f2;
    border-color: #b9e7d7;
}

.auth-alert--error {
    color: #8d241e;
    background: #fff0ee;
    border-color: #fac8c4;
}

.auth-swal-popup {
    width: min(560px, calc(100vw - 24px));
    padding: 1.5rem 1.5rem 1rem;
    border: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
    font-family: 'SolaimanLipi', 'Noto Sans Bengali', 'Poppins', 'Segoe UI', sans-serif !important;
}

.auth-swal-popup .swal2-title {
    margin-bottom: 0.8rem;
    color: #0f172a;
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.25;
}

.auth-swal-popup .swal2-html-container {
    color: #475569;
    font-size: 0.96rem;
    line-height: 1.7;
}

.auth-swal-popup .swal2-actions {
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.auth-swal-popup .swal2-confirm,
.auth-swal-popup .swal2-cancel {
    min-width: 124px;
    min-height: 44px;
    padding: 0.72rem 1.2rem;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    font-size: 0.92rem;
    font-weight: 700;
}

.auth-swal-popup .swal2-confirm {
    background: var(--accent);
    color: #fff;
}

.auth-swal-popup .swal2-confirm:hover,
.auth-swal-popup .swal2-confirm:focus {
    background: var(--accent-dark);
}

.auth-swal-popup .swal2-cancel {
    background: #edf3ff;
    color: #0f172a;
}

.auth-swal-form {
    display: grid;
    gap: 1rem;
    text-align: left;
}

.auth-swal-form p,
.auth-swal-form label {
    margin: 0;
    color: #334155;
    line-height: 1.65;
}

.auth-swal-label {
    display: block;
    margin-bottom: 0.2rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.auth-swal-popup .swal2-input,
.auth-swal-popup .auth-swal-input,
.auth-swal-popup input[type="email"],
.auth-swal-popup input[type="password"],
.auth-swal-popup input[type="text"] {
    width: 100%;
    min-height: 52px;
    padding: 17px 0 5px;
    margin: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 2px solid #1a2029;
    border-radius: 0;
    box-shadow: none !important;
    outline: 0;
    font-family: 'SolaimanLipi', 'Noto Sans Bengali', 'Poppins', 'Segoe UI', sans-serif !important;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.auth-swal-popup .swal2-input::placeholder,
.auth-swal-popup .auth-swal-input::placeholder,
.auth-swal-popup input::placeholder {
    color: #71829a;
    opacity: 1;
}

.auth-swal-popup .swal2-input:focus,
.auth-swal-popup .auth-swal-input:focus,
.auth-swal-popup input:focus,
.auth-swal-popup .swal2-input:focus-visible,
.auth-swal-popup .auth-swal-input:focus-visible,
.auth-swal-popup input:focus-visible {
    border: 0;
    border-bottom: 2px solid var(--accent);
    box-shadow: none !important;
    outline: 0;
}

.auth-swal-message {
    display: none;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #991b1b;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.5;
}

.auth-swal-message.is-success {
    color: #166534;
}

.info-text {
    position: absolute;
    z-index: 4;
    top: 0;
    display: flex;
    align-items: center;
    width: 50%;
    height: 100%;
    color: #fff;
    pointer-events: none;
}

.info-text.login {
    right: 0;
    justify-content: flex-end;
    padding: 0 50px 30px 135px;
    text-align: right;
}

.info-text.signup {
    left: 0;
    padding: 0 160px 30px 38px;
    text-align: left;
}

.info-content {
    max-width: 260px;
}

.info-text.signup .info-content {
    max-width: 225px;
}

.panel-logo {
    display: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 124px;
    height: 124px;
    margin-bottom: 14px;
    padding: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.24),
        0 0 0 5px rgba(255, 255, 255, 0.06);
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.28);
}

.info-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.62);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.info-text h2 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 3vw, 2.55rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: 0;
}

.info-text.signup h2 {
    font-size: clamp(1.8rem, 2.4vw, 2.15rem);
}

.info-text p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.87rem;
    line-height: 1.75;
}

.animation {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    transition:
        opacity 700ms ease,
        transform 700ms ease;
}

.wrapper.is-transitioning .animation {
    will-change: opacity, transform;
}

.form-box.login .animation {
    transition-delay: calc(2100ms + 100ms * var(--step));
}

.info-text.login .animation {
    transition-delay: calc(2000ms + 100ms * var(--step));
}

.form-box.signup .animation {
    opacity: 0;
    transform: translate3d(120%, 0, 0);
    transition-delay: calc(100ms * var(--step));
}

.info-text.signup .animation {
    opacity: 0;
    transform: translate3d(-120px, 0, 0);
    transition-delay: calc(100ms * var(--step));
}

.wrapper.is-signup-active .form-box.login .animation {
    opacity: 0;
    transform: translate3d(-120%, 0, 0);
    transition-delay: calc(100ms * var(--step));
}

.wrapper.is-signup-active .info-text.login .animation {
    opacity: 0;
    transform: translate3d(120px, 0, 0);
    transition-delay: calc(100ms * var(--step));
}

.wrapper.is-signup-active .form-box.signup .animation,
.wrapper.is-signup-active .info-text.signup .animation {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition-delay: calc(1700ms + 100ms * var(--step));
}

:focus-visible {
    outline: 3px solid rgba(20, 115, 230, 0.36);
    outline-offset: 3px;
}

.input-box input:focus-visible {
    outline: 0;
}

@media (min-width: 821px) and (max-height: 680px) {
    .auth-page {
        align-items: flex-start;
        padding-block: 20px;
    }

    .wrapper {
        height: 560px;
        margin-block: auto;
    }

    .form-box.login {
        padding-block: 32px;
    }

    .form-box.signup {
        padding-block: 24px;
    }
}

@media (max-width: 980px) {
    .auth-page {
        justify-content: center;
        padding-inline: 28px;
    }
}

@media (max-width: 820px) {
    .auth-page {
        align-items: flex-start;
        justify-content: center;
        padding: 28px 20px;
        background-position: 67% center;
    }

    .auth-page__overlay {
        background: rgba(4, 14, 23, 0.58);
    }

    .wrapper {
        width: min(540px, 100%);
        height: auto;
        min-height: 0;
        margin-block: auto;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.98);
    }

    .wrapper::before {
        display: block;
        height: 7px;
        background: linear-gradient(90deg, #10151d 0 58%, var(--accent) 58% 100%);
        content: '';
    }

    .rotate-bg,
    .rotate-bg2,
    .info-text {
        display: none;
    }

    .form-box {
        position: relative;
        inset: auto;
        display: none;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow: visible;
        visibility: visible;
    }

    .form-box.login {
        display: flex;
        padding: 46px 48px 42px;
    }

    .form-box.signup {
        padding: 38px 48px 36px;
    }

    .wrapper.is-signup-active .form-box.login {
        display: none;
    }

    .wrapper.is-signup-active .form-box.signup {
        display: flex;
    }

    .animation,
    .form-box.signup .animation,
    .wrapper.is-signup-active .form-box.login .animation,
    .wrapper.is-signup-active .form-box.signup .animation {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .wrapper.is-transitioning:not(.is-signup-active) .form-box.login,
    .wrapper.is-transitioning.is-signup-active .form-box.signup {
        animation: auth-mobile-panel-enter 360ms var(--auth-enter-ease) both;
    }

    .form-content {
        margin: 0;
    }

    .panel-heading {
        margin-bottom: 28px;
    }

    .panel-logo {
        display: block;
        width: 92px;
        height: 92px;
        margin: 0 0 14px;
        object-fit: contain;
        transform: scale(1.28);
        transform-origin: left center;
    }

    .form-box.signup .panel-heading {
        margin-bottom: 22px;
    }

    .form-box.signup .auth-form {
        gap: 16px;
    }

    .has-google-auth .panel-heading,
    .has-google-auth .form-box.signup .panel-heading {
        margin-bottom: 20px;
    }

    .has-google-auth .form-box.signup {
        padding: 38px 48px 36px;
    }

    .has-google-auth .auth-form,
    .has-google-auth .form-box.signup .auth-form {
        gap: 16px;
    }

    .has-google-auth .form-box.signup .input-box {
        height: 52px;
    }

    .google-auth {
        margin-bottom: 18px;
    }
}

@keyframes auth-mobile-panel-enter {
    from {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scale(0.995);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 14px;
    }

    .wrapper {
        border-radius: 20px;
    }

    .form-box.login,
    .form-box.signup {
        padding: 34px 24px 30px;
    }

    .panel-heading h1 {
        font-size: 1.72rem;
    }

    .panel-heading p {
        font-size: 0.82rem;
    }

    .auth-form,
    .form-box.signup .auth-form {
        gap: 15px;
    }

    .input-box {
        height: 50px;
    }

    .auth-button {
        min-height: 47px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
}
