@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotate {
    0% {
        --angle: 0deg;
    }

    100% {
        --angle: 360deg;
    }
}

/* Base Styles */

:root {
    --p50: #eaecf1;
    --p75: #a7b0c7;
    --p100: #8390b0;
    --p200: #4d608d;
    --p300: #293f76;
    --p400: #1d2c53;
    --p500: #192648;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    border: 0;
    outline: 0;
    list-style-type: none;
    scroll-behavior: smooth;
}

img {
    max-width: 40px;
}

/* Animate */

.animate {
    opacity: 0;
    visibility: hidden;
    translate: 0 20px;
    transition: all 500ms ease-out;
}

.animate.show {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
}

/* Card style from Landing Page */

card {
    display: flex;
    max-width: 400px;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 24px 36px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.6, 0.07, 0.07, 0.89);
    border: 1px solid #0002;
    border-radius: 24px;
    filter: drop-shadow(0 18px 35px #0002);
}

card>* {
    width: 100%;
}

.card--special::before,
.card--special::after {
    position: absolute;
    content: "";
    padding: 2px;
    background: linear-gradient(var(--angle),
            transparent 5%,
            #161aff 40%,
            #810aff 50%,
            #161aff 60%,
            transparent 95%);
    animation: rotate 8s linear infinite forwards;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    z-index: -2;
}

.card--special::after {
    padding: 0;
    background: white;
    border-radius: 22px;
}

.card__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title__recommended,
.card__discount p {
    opacity: 1;
    color: var(--p300);
    background: var(--p50);
    padding: 0.625rem 1rem;
    border-radius: 36px;
}

.card__discount {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.card__discount s {
    opacity: 0.7;
}

.card__discount p {
    padding: 0.5rem 0.75rem;
}

.card__price {
    color: var(--p300);
    font-weight: 600;
}

.card__price span {
    font-size: 3.9rem;
    font-weight: 800;
    margin: 0 0.25rem;
}

card>a {
    display: flex;
    justify-content: space-between;
    color: var(--p300);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Layout */

body {
    position: relative;
    transition: all 0.5s ease;
}

body.fade {
    opacity: 0.3;
    user-select: none;
    pointer-events: none;
    transition: all 0.5s ease;
}

main {
    max-width: 1400px;
    display: flex;
    margin: auto;
    height: 100vh;
}

.container {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container__content {
    display: flex;
    flex-flow: column;
    padding: 0 24px;
    margin: auto;
    gap: 12px;
}

.form__title {
    padding-bottom: 8px;
    margin-top: 8px;
}

.container__content:has(.content__form) {
    width: 100%;
}

/* Content Left */

.bg--gray {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #eff0f4;
    z-index: -4;
}

.content__btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    color: var(--p200);
    font-weight: 500;
}

.content__btn-back:hover {
    opacity: 0.5;
}

/* Content Right */

.content__form {
    width: 100%;
    display: flex;
    flex-flow: column;
    padding: 16px;
}

.content__form.input__form {
    gap: 13px;
}

/* Steps list */

.drag-handler {
    margin: auto;
    display: none;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--p200);
}

.form__navigation {
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    border-bottom: 1.2px solid #0002;
    margin: auto;
    width: 100%;
    justify-content: space-around;
}

.form__navigation li {
    display: flex;
    flex-flow: wrap;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.form__navigation li span {
    display: inline-flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    width: 30px;
    border-radius: 30px;
    aspect-ratio: 1/1;
    margin-right: 12px;
    background: #eee;
}

.form__navigation li[active] span {
    background: var(--p200);
    color: white;
}

.form__navigation li:not([active]) {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
    user-select: none;
}

/* Input */

.form__username,
.form__region {
    width: 100%;
    display: flex;
    gap: 24px;
}

.input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.input-group .validation {
    color: #ff5f5f;
    opacity: 0;
}

.validation.error {
    opacity: 1;
}

input:not([type="radio"]) {
    width: 100%;
    outline: 2px solid rgba(28, 28, 28, 0.15);
    padding: 0 24px;
    height: 44px;
    border-radius: 8px;
    transition: all 0.1s ease;
    color: #1c1c1c;
}

input.invalid:not([type="radio"]) {
    outline: 2px solid #ff2828 !important;
}

input:focus:not([type="radio"]) {
    outline: 4px solid #166bff5a;
}

input.invalid:focus:not([type="radio"]) {
    outline: 4px solid #ff28285a !important;
}

input::placeholder {
    font-family: "Inter";
    font-size: 1rem;
    font-weight: 600;
    color: #1c1c1c;
    opacity: 0.4;
}

button:disabled {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

.form__email {
    position: relative;
    display: flex;
    align-items: center;
}

.form__email svg {
    display: none;
    position: absolute;
    right: 20px;
    color: var(--p100);
    stroke-width: 2px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
}

/* button */

.btn--large {
    height: 44px;
    border-radius: 16px;
    font-weight: 500;
    font-size: 1.1rem;
}

/* Payment Method */

.form__payment-method {
    display: flex;
    flex-flow: column;
    gap: 5px;
    padding: 10px 20px;
    border: 1px solid #0002;
    border-radius: 24px;
}

.form__payment-method input[type="radio"] {
    appearance: none;
    width: 18px;
    aspect-ratio: 1/1;
    border-radius: 36px;
    background: transparent;
    border: 2px solid #0005;
    cursor: pointer;
    transition: all 0.1s ease;
}

.form__payment-method input[type="radio"]:checked {
    background: white;
    width: 20px;
    border: 6px solid #161aff;
}

.payment__title {
    margin: 6px 0;
}

.payment__method {
    display: flex;
    flex: 1;
    justify-content: space-between;
    padding: 8px 12px;
    align-items: center;
}

.payment__method span {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Ringkasan pesanan */

.form__summary div,
.form__total {
    display: flex;
    margin-bottom: 12px;
    justify-content: space-between;
    color: rgba(28, 28, 28, 0.7);
}

.form__summary span {
    color: #1c1c1c;
    font-size: 1rem;
    font-weight: 600;
}

.form__total {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #1c1c1c;
}

.form__total span {
    font-size: 1.25rem;
    font-weight: 700;
}

.form__alert {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    color: rgba(28, 28, 28, 0.8);
    font-weight: 500;
    flex: 1;
}

.form__alert svg {
    color: var(--p200);
    stroke-width: 3px;
    width: 16px;
}

/* Complete */

.form__checkout {
    width: 100%;
    display: flex;
    flex-flow: column;
    align-items: center;
    padding: 24px;
    gap: 12px;
}

.form__checkout>* {
    width: 100%;
    text-align: center;
}

.checkout__bank {
    width: fit-content;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1/1;
    background: #eee;
    border-radius: 36px;
}

.checkout__to span {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 12px;
    color: var(--p300);
    transition: all 0.1s ease;
    cursor: pointer;
}

.checkout__price {
    font-weight: 600;
    font-size: 3rem;
}

.form__checkout p {
    font-size: 0.9rem;
}

.form__code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.code__reveal {
    width: fit-content;
    color: rgba(28, 28, 28, 0.5);
}

.code__reveal span {
    color: #1c1c1c;
}

.code__copy {
    font-weight: 500;
    font-family: "Inter";
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: #eee;
    padding: 10px 14px;
    color: var(--p300);
    border-radius: 8px;
    cursor: pointer;
}

.code__copy:hover {
    opacity: 0.7;
}

.form__duration {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ff8c18;
    padding: 12px 16px;
    width: fit-content;
    border-radius: 8px;
    background: #fff6de;
    margin: 0 auto;
}

.howTo__title {
    margin-bottom: 16px;
}

.howTo__list li {
    list-style-type: disc;
    list-style-position: inside;
    color: rgba(28, 28, 28, 0.7);
}

.howTo__list li span {
    color: rgba(28, 28, 28, 0.8);
    font-weight: 600;
}

@media (max-width: 768px) {
    html {
        font-size: 10px;
    }

    main {
        display: block;
    }

    .container {
        padding: 24 px 0;
        height: 100vh;
    }

    .container:first-child {
        padding: 24px 0;
        height: fit-content;
    }

    .container:first-child .container__content {
        opacity: 0;
        transition: all 700ms cubic-bezier(0.63, 0.09, 0.17, 0.93);
    }

    .container:first-child.dark .container__content {
        opacity: 1;
    }

    .container:last-child {
        position: absolute;
        width: 100%;
        height: fit-content;
        top: 0;
        background: white;
        border-top-left-radius: 48px;
        border-top-right-radius: 48px;
        transition: all 700ms cubic-bezier(0.63, 0.09, 0.17, 0.93);
    }

    .container:last-child.move--down {
        top: 65%;
    }

    .container:last-child.move--down .drag-handler svg {
        rotate: 180deg;
    }

    .container:first-child .content__btn-back {
        display: none;
    }

    .container__content {
        padding: 16px;
    }

    .content__form {
        padding: 0;
    }

    .drag-handler {
        display: flex;
        transition: all 0.2s ease;
        cursor: pointer;
    }

    .drag-handler svg {
        animation: wiggle 800ms infinite forwards;
        transition: all 700ms cubic-bezier(0.63, 0.09, 0.17, 0.93);
    }

    @keyframes wiggle {
        0% {
            translate: 0 3px;
        }

        50% {
            translate: 0 -3px;
        }

        100% {
            translate: 0 3px;
        }
    }

    .drag-handler:hover {
        color: var(--p100);
    }

    input:not([type="radio"]) {
        height: 44px !important;
        border-radius: 4px !important;
    }
}