@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Poppins:wght@400;500;600;700&display=swap");

:root {
    --bk-base-100: #ffffff;
    --bk-base-200: #f4ede6;
    --bk-base-300: #ebe2d8;
    --bk-base-content: #1f1b16;

    --bk-ink-900: #1f1b16;
    --bk-ink-700: #4a4036;
    --bk-ink-500: #6f665d;

    --bk-primary: #233B4D;
    --bk-primary-hover: #1C2F3E;
    --bk-accent: #FF6F00;

    --bk-accent-500: var(--bk-primary);
    --bk-accent-600: var(--bk-primary-hover);
    --bk-accent-content: #ffffff;

    --bk-danger: #c13c3c;
    --bk-danger-soft: rgba(193, 60, 60, 0.18);

    --bk-border: #e6dcd2;
    --bk-border-strong: #d9cec3;
    --bk-border-focus: var(--bk-primary);
    --bk-border-width: 1px;

    --bk-radius-field: 12px;
    --bk-radius-box: 28px;

    --bk-shadow-card: 0 28px 70px rgba(35, 59, 77, 0.16);
    --bk-focus-ring: 0 0 0 3px rgba(35, 59, 77, 0.25);
    --bk-transition: 180ms ease;
}

.terme-auth {
    background: #ffffff;
    padding: 0;
    min-height: calc(100svh - 5rem);
    display: block;
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    position: relative;
}

.terme-auth,
.terme-auth * {
    box-sizing: border-box;
    font-family: "Poppins", "Segoe UI", sans-serif;
}

.terme-auth__shell {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    border-radius: 0;
    overflow: hidden;
    background: #ffffff;
    box-shadow: none;
    border: 0;
    min-height: calc(100svh - 5rem);
    padding: 0;
}

.terme-auth__panel {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(2rem, 4.2vw, 4rem) clamp(1.5rem, 3.8vw, 4rem);
    background: #ffffff;
    border-radius: 0;
    border: 0;
    box-shadow: none;
}

.terme-auth__panel-inner {
    width: min(31rem, 100%);
    margin: 0 auto;
}

.terme-auth__content {
    width: 100%;
    display: grid;
    gap: 0;
}

.terme-auth__views {
    position: relative;
}

.terme-auth__mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem;
    border-radius: 999rem;
    border: 0.0625rem solid #d8d2ca;
    background: #f4f4f4;
    box-shadow: none;
    margin-bottom: 1.6rem;
}

.terme-auth__mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.2rem;
    padding: 0.6rem 1rem;
    border-radius: 999rem;
    color: var(--bk-ink-500);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background var(--bk-transition), color var(--bk-transition), box-shadow var(--bk-transition);
}

.terme-auth__mode-btn:hover {
    color: var(--bk-ink-900);
}

.terme-auth__mode-btn.is-active {
    background: var(--bk-primary);
    color: #fff;
    box-shadow: none;
}

.terme-auth__mode-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.1875rem rgba(35, 59, 77, 0.18);
}

.terme-auth__view {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

.terme-auth__view.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: terme-auth-fade-up 420ms ease both;
}

.terme-auth__media {
    position: relative;
    background: #e9e1d8;
    overflow: hidden;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    min-height: calc(100svh - 5rem);
}

.terme-auth__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    animation: terme-auth-zoom 1200ms ease both;
}

/* Keep customer auth pages aligned with the SaaS auth layout. */
.terme-auth--customer .terme_login,
.terme-auth--customer .terme_signup,
.terme-auth--customer .terme_forgot_password {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    margin: 0;
    overflow: visible;
    position: static;
}

.terme-auth--customer .terme_login::before {
    content: none;
}

.terme-auth--customer .terme_header {
    padding: 0;
    text-align: left;
    font-family: "Poppins", "Segoe UI", sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.3rem);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.terme-auth--customer .terme_form {
    padding: 0;
}

.terme_login .account_not_activated_step,
.terme_signup .terme_step_2,
.terme_forgot_password .terme_step_2 {
    display: none;
}

.terme_header,
.terme_signup_completed_title,
.terme_forgot_password_completed_title {
    font-family: "Poppins", "Segoe UI", sans-serif;
    color: var(--bk-ink-900);
    font-size: clamp(2rem, 3vw, 2.4rem);
    font-weight: 600;
    margin-bottom: 0.85rem;
    letter-spacing: -0.04em;
}

.terme-auth__intro {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.6rem;
}

.terme-auth__subtitle {
    margin: 0;
    max-width: 34rem;
    color: var(--bk-ink-500);
    font-size: 0.95rem;
    line-height: 1.8;
}

.terme-auth__social-block {
    display: grid;
    gap: 0.95rem;
}

.terme-auth__social-caption {
    color: #7a8594;
    font-size: 0.9rem;
    font-weight: 600;
}

.terme-auth__separator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #9ca7b2;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.terme-auth__separator::before,
.terme-auth__separator::after {
    content: "";
    flex: 1 1 0;
    height: 0.0625rem;
    background: #e5ddd4;
}

.terme_form {
    display: grid;
    gap: 1rem;
}

.terme_form_element {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.terme_customer_info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.terme_form_element label {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #5d6572;
}

.terme_form > div:not(.terme_form_element):not(.terme_resend_trigger):not(.terme-auth__social-block) {
    margin-top: -0.2rem;
}

.terme_form > .terme_signin_actions {
    margin-top: 0;
}

.terme_signin_forgot {
    margin-bottom: 0;
}

.terme_signin_actions > .terme_login_btn {
    margin-top: 0.9rem;
}

.terme_form_element input[type="text"],
.terme_form_element input[type="password"],
.terme_form_element input[type="email"],
.terme_form_element input:not([type="checkbox"]):not([type="radio"]),
.terme_form_element select,
.terme_form_element textarea {
    width: 100%;
    min-height: 3.45rem;
    padding: 0.9rem 1rem;
    border: 0.0625rem solid #ddd4cb;
    border-radius: 0.75rem;
    background: #fff;
    color: var(--bk-ink-900);
    font-size: 0.95rem;
    font-weight: 400;
    transition: border-color var(--bk-transition), box-shadow var(--bk-transition), background var(--bk-transition), transform var(--bk-transition);
}

.terme_form_element input:not([type="checkbox"]):not([type="radio"]):focus,
.terme_form_element select:focus,
.terme_form_element textarea:focus {
    outline: none;
    border-color: #8ea7bc;
    box-shadow: 0 0 0 0.25rem rgba(219, 230, 239, 0.9);
    background: #ffffff;
}

.terme_form_element.is-invalid label {
    color: var(--bk-danger);
}

.terme_customer_info.is-invalid label {
    color: var(--bk-danger);
}

.terme_form_element.is-invalid input:not([type="checkbox"]):not([type="radio"]),
.terme_form_element.is-invalid select,
.terme_form_element.is-invalid textarea {
    border-color: var(--bk-danger);
    box-shadow: 0 0 0 0.1875rem var(--bk-danger-soft);
    background: #fff7f7;
}

.terme_customer_info.is-invalid input {
    border-color: var(--bk-danger);
    box-shadow: 0 0 0 0.1875rem var(--bk-danger-soft);
    background: #fff7f7;
}

.terme_form_element_checkbox.is-invalid {
    border: 0.0625rem solid var(--bk-danger);
    background: var(--bk-danger-soft);
    border-radius: var(--bk-radius-field);
    padding: 0.6rem 0.75rem;
}

.terme_field_error {
    color: var(--bk-danger);
    font-size: 0.85rem;
    line-height: 1.4;
}

.terme_customer_info .terme_field_error {
    width: 100%;
}

.terme_form_element_checkbox .terme_field_error {
    flex-basis: 100%;
    padding-left: 2.75rem;
}

.terme_form_element_checkbox .terme_field_error:empty {
    display: none;
}

.terme_form_element_row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.terme_form_element_checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0;
    padding: 0.625rem 0.75rem;
    font-size: 0.86rem;
    color: var(--bk-ink-700);
    flex-wrap: wrap;
    border: 0.0625rem solid #ece3db;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
}

.terme_legal_consent {
    position: relative;
    cursor: pointer;
}

.terme_form_element .terme_legal_consent__input {
    position: absolute;
    inline-size: 0.0625rem;
    block-size: 0.0625rem;
    height: 0.0625rem;
    min-height: 0;
    width: 0.0625rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.terme_legal_consent__control {
    inline-size: 1.35rem;
    block-size: 1.35rem;
    flex: 0 0 1.35rem;
    margin-top: 0;
    position: relative;
    border: 0.125rem solid rgba(105, 130, 154, 0.9);
    border-radius: 0.45rem;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color var(--bk-transition), box-shadow var(--bk-transition), background var(--bk-transition);
}

.terme_legal_consent__control::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    inline-size: 0.36rem;
    block-size: 0.7rem;
    border: solid #fff;
    border-width: 0 0.13rem 0.13rem 0;
    transform: translate(-50%, -58%) rotate(45deg);
    opacity: 0;
    transition: opacity 120ms ease;
}

.terme_legal_consent__input:checked + .terme_legal_consent__control {
    background: var(--bk-primary);
    border-color: var(--bk-primary);
    box-shadow: 0 0.25rem 0.75rem rgba(35, 59, 77, 0.2);
}

.terme_legal_consent__input:checked + .terme_legal_consent__control::after {
    opacity: 1;
}

.terme_legal_consent__input:focus-visible + .terme_legal_consent__control {
    outline: none;
    border-color: var(--bk-border-focus);
    box-shadow: var(--bk-focus-ring);
}

.terme_form_element_checkbox.is-invalid .terme_legal_consent__control {
    border-color: var(--bk-danger);
    background: #fff7f7;
    box-shadow: 0 0 0 0.1875rem var(--bk-danger-soft);
}

.terme_legal_consent__text {
    flex: 1 1 0;
    min-width: 0;
    padding-top: 0;
    line-height: 1.45;
    font-size: 0.86rem;
    color: #66707d;
    cursor: pointer;
}

.terme_legal_consent__text a {
    color: var(--bk-primary);
    font-weight: 600;
    text-underline-offset: 0.125rem;
}

.terme_legal_consent__text a:hover {
    color: var(--bk-primary-hover);
}

.terme_legal_consent__text a:focus-visible {
    outline: none;
    box-shadow: var(--bk-focus-ring);
    border-radius: 0.25rem;
}

.terme_btn_primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.5rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--bk-accent-500);
    background: var(--bk-accent-500);
    color: var(--bk-accent-content);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: transform var(--bk-transition), box-shadow var(--bk-transition), background var(--bk-transition), border-color var(--bk-transition);
    cursor: pointer;
    text-decoration: none;
}

.terme_footer .terme_btn_primary {
    width: auto;
    padding-inline: 1.5rem;
}

.terme-auth-social {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.75rem;
}

.terme-auth-social__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 3.25rem;
    border: 0.0625rem solid #e1d7ce;
    background: #fff;
    color: #5f6875;
    border-radius: 0.75rem;
    padding: 0.85rem 0.75rem;
    box-shadow: none;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0;
    transition: border-color var(--bk-transition), background var(--bk-transition), color var(--bk-transition);
    cursor: pointer;
}

.terme-auth-social__icon {
    font-size: 0.95rem;
    line-height: 1;
}

.terme-auth-social__label {
    line-height: 1.2;
}

.terme-auth-social__btn:hover {
    transform: none;
    border-color: #cbc3b8;
    background: #f8f8f8;
    box-shadow: none;
}

.terme-auth-social__btn:focus-visible {
    outline: none;
    box-shadow: var(--bk-focus-ring);
    border-color: #d1c3b7;
}

.terme_btn_primary:hover {
    background: var(--bk-accent-600);
    border-color: var(--bk-accent-600);
    box-shadow: 0 1rem 2.125rem rgba(33, 58, 82, 0.25);
    transform: translateY(-0.08rem);
}

.terme_btn_primary:focus-visible {
    outline: none;
    box-shadow: var(--bk-focus-ring);
}

.terme_btn_link {
    background: none;
    border: none;
    padding: 0;
    color: var(--bk-primary);
    font-weight: 400;
    cursor: pointer;
}

.terme_btn_link:hover {
    color: var(--bk-primary-hover);
}

.terme_forgot_password {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #7a8594;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.2;
}

.terme_forgot_password img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transform: translateY(1px);
}

.terme_footer {
    margin-top: 1.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: #7a8594;
    font-size: 0.92rem;
    border-top: 0.0625rem solid #e4dbd2;
    padding-top: 1.4rem;
}

.terme_footer a {
    color: var(--bk-primary);
    font-weight: 500;
}

.terme_footer a:hover {
    color: var(--bk-accent);
}

.terme_check_your_email,
.terme_signup_completed_subtitle,
.terme_forgot_password_completed_subtitle {
    color: var(--bk-ink-500);
    font-size: 0.98rem;
    line-height: 1.5;
}

.terme_pending_notice {
    margin-top: 0.85rem;
    color: var(--bk-ink-700);
    background: var(--bk-base-200);
    border: 0.0625rem dashed var(--bk-border);
    border-radius: var(--bk-radius-field);
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.terme-auth-social-error {
    margin-bottom: 0.25rem;
}

.terme_email_success,
.terme_signup_completed,
.terme_forgot_password_completed {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.terme_email_success img,
.terme_signup_completed img,
.terme_forgot_password_completed img {
    max-width: 150px;
}

.terme_resend_activation {
    margin-top: 1rem;
    align-items: center;
    gap: 0.75rem;
}

.terme_signup_completed_footer,
.terme_forgot_password_completed_footer {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.terme_signup_completed_subtitle span {
    font-weight: 600;
    color: var(--bk-ink-900);
}

@keyframes terme-auth-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes terme-auth-zoom {
    from {
        transform: scale(1.05);
    }
    to {
        transform: scale(1);
    }
}

@media (min-width: 60.0625rem) {
    .terme-auth {
        min-height: 0;
        block-size: var(--terme-auth-available-height, calc(100svh - 5rem));
    }

    .terme-auth__shell {
        min-height: 0;
        block-size: var(--terme-auth-available-height, calc(100svh - 5rem));
    }

    .terme-auth__panel {
        min-block-size: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .terme-auth__media {
        min-height: 0;
        min-block-size: 0;
        block-size: 100%;
    }
}

@media (max-width: 960px) {
    .terme-auth {
        min-height: auto;
        block-size: auto;
    }

    .terme-auth__shell {
        grid-template-columns: 1fr;
        min-height: auto;
        block-size: auto;
    }

    .terme-auth__media {
        display: none;
        block-size: auto;
    }

    .terme-auth__panel {
        border-radius: 0;
        padding: clamp(1.25rem, 4.5vw, 2rem) clamp(1rem, 4vw, 1.5rem);
        overflow: visible;
    }

    .terme-auth__panel-inner {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .terme-auth__mode-switch {
        width: 100%;
        justify-content: space-between;
    }

    .terme-auth__mode-btn {
        flex: 1 1 0;
    }

    .terme_form_element_row {
        grid-template-columns: 1fr;
    }

    .terme-auth-social {
        gap: 0.55rem;
    }

    .terme-auth-social__btn {
        font-size: 0.78rem;
        padding-inline: 0.5rem;
    }

    .terme_footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .terme-auth__view.is-active,
    .terme-auth__media img {
        animation: none;
    }
}
