* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    background: var(--main-bg-color);
    font-family: Inter, sans-serif;
}

/* header */

.sign-up-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1440px;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 67px 122px 48px 77px;
}

.sign-up-header {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-height: 122px;
}

.sign-up-logo {
    width: 100px;
    height: auto;
}

/* main */

.signup-main {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding-top: 64px;
}

.textbox {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.text-box {
    position: relative;
    width: 598px;
    min-height: 630px;
    padding: 48px 0 40px;
    background: var(--assets-bg-color);
    border-radius: 30px;
    box-shadow: 0 2px 10px var(--shadow-black-12);
}

/* back arrow */

.back-to-login {
    position: absolute;
    top: 64px;
    left: 48px;
    cursor: pointer;
}

.back-to-login img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* title */

.textbox-signup {
    display: flex;
    justify-content: center;
}

.textbox-signup h1 {
    display: inline-block;
    position: relative;
    margin: 0;
    padding-bottom: 15px;
    color: var(--text-primary);
    font-size: 3.8125rem;
    font-weight: 700;
    line-height: 120%;
}

.textbox-signup h1::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 60%;
    min-width: 80px;
    max-width: 150px;
    height: 3px;
    background: var(--divider-color-blue);
    border-radius: 2px;
    content: "";
    transform: translateX(-50%);
}

/* input fields */

.textbox-inputfield-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 32px;
}

.textbox-inputfield {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 422px;
}

.signup-input-field {
    position: relative;
    width: 100%;
}

.signup-input-field input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 21px;
    background: var(--assets-bg-color);
    border: 1px solid var(--board-input-border);
    border-radius: 10px;
    outline: none;
    color: var(--text-primary);
    font-family: Inter, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    transition: border-color 125ms ease-in-out, box-shadow 125ms ease-in-out;
}

.signup-input-field input:hover {
    border-color: var(--board-input-border-hover);
    box-shadow: 0 0 4px var(--shadow-black-16);
}

.signup-input-field input:focus-visible {
    border-color: var(--board-input-border-active);
    box-shadow: 0 0 4px var(--shadow-black-16);
}

.signup-input-field input.error {
    display: flex;
    border-color: var(--form-input-border-error);
}

.error-msg {
    min-height: 16px;
    margin: 0 0 6px;
    overflow: hidden;
    color: var(--form-input-border-error);
    font-size: 1rem;
    font-weight: 400;
    line-height: 16px;
}

.signup-input-field>img,
.signup-input-field .password-toggle {
    position: absolute;
    top: 50%;
    right: 21px;
    width: 24px;
    height: 24px;
    object-fit: contain;
    pointer-events: none;
    transform: translateY(-50%);
}

.signup-input-field .password-toggle {
    padding: 0;
    background: none;
    cursor: pointer;
    pointer-events: auto;
}

.signup-input-field .password-toggle:disabled {
    cursor: default;
}

.signup-input-field .password-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.visually-hidden {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
}

/* checkbox */

.textbox-checkbox {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 0;
}

.textbox-checkbox .custom-checkbox-wrapper {
    margin-right: 8px;
}

label {
    color: var(--text-tertiary);
    font-size: 1rem;
    font-weight: 400;
}

.textbox-checkbox a {
    margin-left: 5px;
    color: var(--text-link-hover-dark);
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
}

.textbox-checkbox a:hover {
    color: var(--text-link-hover);
}

/* button */

.btn {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.signup-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 91px;
    height: 49px;
    padding: 0;
    background: var(--login-button-primary-bg);
    border: none;
    border-radius: 8px;
    color: var(--text-white);
    font-family: Inter, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 125ms ease-in-out, box-shadow 125ms ease-in-out;
}

.signup-btn:hover:not(:disabled) {
    background: var(--login-button-primary-bg-hover);
    box-shadow: 0 4px 4px var(--shadow-black-25);
}

.signup-btn:active:not(:disabled) {
    background: var(--login-button-primary-bg-active);
}

.signup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* footer */

footer {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: auto;
    padding: 16px 0 0;
}

footer a {
    color: var(--text-link);
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
}

footer a:hover {
    color: var(--text-link-hover-dark);
}

.signup-toast {
    display: flex;
    position: fixed;
    top: 100%;
    left: 50%;
    z-index: 100;
    align-items: center;
    gap: 32px;
    padding: 16px 24px;
    background-color: var(--ui-dark);
    border-radius: 10px;
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 400;
    pointer-events: none;
    transition: top 0.4s ease, transform 0.4s ease;
    transform: translate(-50%, 0);
}

.signup-toast.show {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* RESPONSIVE */

/* tablet */

@media (width <=900px) {
    .sign-up-content {
        padding: 37px 32px 32px;
    }

    .sign-up-header {
        min-height: 88px;
    }

    .sign-up-logo {
        width: 72px;
    }

    .text-box {
        width: min(598px, calc(100% - 48px));
    }
}

/* mobile */

@media (width <=768px) {
    .sign-up-content {
        padding: 24px 16px 18px;
    }

    .sign-up-header {
        min-height: 80px;
    }

    .sign-up-logo {
        width: 64px;
    }

    .signup-main {
        padding-top: clamp(16px, 3dvh, 48px);
    }

    .text-box {
        width: calc(100% - 32px);
        min-height: auto;
        padding: 40px 0 32px;
        border-radius: 24px;
    }

    .back-to-login {
        top: 48px;
        left: 32px;
    }

    .textbox-signup h1 {
        padding-bottom: 12px;
        font-size: 3rem;
    }

    .textbox-inputfield {
        gap: 4px;
        width: calc(100% - 80px);
    }

    .signup-input-field input {
        height: 48px;
        font-size: 1.125rem;
    }

}

/* error message wraps to two lines below ~390px; reserve the extra height so it doesn't shift layout */

@media (width <=425px) {
    .error-msg {
        min-height: 32px;
    }
}

/* small mobile */

@media (width <=480px) {
    body {
        min-height: 100dvh;
    }

    .signup-main {
        flex: 0;
        align-items: flex-start;
        padding-top: 8px;
    }

    .text-box {
        width: calc(100% - 32px);
        min-height: auto;
        padding: 28px 0 24px;
        border-radius: 20px;
    }

    .back-to-login {
        top: 42px;
        left: 24px;
        width: 28px;
        height: 28px;
    }

    .back-to-login img {
        width: 28px;
        height: 28px;
    }

    .textbox-signup h1 {
        padding-bottom: 12px;
        font-size: 2.25rem;
        line-height: 100%;
    }

    .textbox-signup h1::after {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
    }

    .textbox-inputfield-wrapper {
        padding-top: 24px;
    }

    .textbox-inputfield {
        gap: 4px;
        width: calc(100% - 32px);
    }

    .signup-input-field input {
        height: 44px;
        padding: 0 42px 0 16px;
        font-size: 1rem;
    }

    .signup-input-field>img,
    .signup-input-field .password-toggle {
        right: 16px;
        width: 20px;
        height: 20px;
    }

    .textbox-checkbox {
        padding-top: 2px;
    }

    label,
    .textbox-checkbox a {
        font-size: 1rem;
    }

    .btn {
        padding-top: 8px;
    }

    .signup-btn {
        width: 104px;
        height: 44px;
        font-size: 1rem;
    }

    footer {
        gap: 24px;
        padding-top: 20px;
    }

    footer a {
        font-size: 1rem;
    }
}

/* very small mobile */

@media (width <=360px) {
    .sign-up-content {
        padding-inline: 14px;
    }

    .sign-up-header {
        min-height: 74px;
    }

    .sign-up-logo {
        width: 58px;
    }

    .signup-main {
        padding-top: 4px;
    }

    .text-box {
        width: calc(100% - 24px);
        padding: 24px 0 20px;
    }

    .back-to-login {
        top: 36px;
        left: 22px;
    }

    .textbox-signup h1 {
        font-size: 2.125rem;
    }

    .textbox-inputfield-wrapper {
        padding-top: 20px;
    }

    .textbox-inputfield {
        gap: 3px;
    }

    .signup-input-field input {
        height: 42px;
        font-size: 1rem;
    }

    .btn {
        padding-top: 6px;
    }

}
