/* Gludo — auth pages */

.auth-page {
    padding-bottom: 2.5rem;
}

.auth-page__header h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 0.75rem;
}

.auth-panel {
    max-width: 32rem;
    margin-inline: auto;
    padding: 1.5rem;
}

.auth-panel--publisher {
    max-width: 42rem;
}

.auth-type-picker {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.auth-type-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.auth-type-card {
    display: block;
    cursor: pointer;
}

.auth-type-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-type-card__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    height: 100%;
    padding: 1rem 0.75rem;
    border: 2px solid var(--gludo-border);
    border-radius: var(--gludo-radius);
    background: var(--gludo-surface);
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.auth-type-card__box:hover {
    border-color: color-mix(in srgb, var(--gludo-primary) 45%, var(--gludo-border));
    transform: translateY(-1px);
}

.auth-type-card input:checked + .auth-type-card__box {
    border-color: var(--gludo-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gludo-primary) 18%, transparent);
    background: color-mix(in srgb, var(--gludo-primary) 6%, var(--gludo-surface));
}

.auth-type-card input:focus-visible + .auth-type-card__box {
    outline: 2px solid color-mix(in srgb, var(--gludo-primary) 45%, transparent);
    outline-offset: 2px;
}

.auth-type-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--gludo-primary) 12%, var(--gludo-surface));
    color: var(--gludo-primary);
}

.auth-type-card__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.auth-type-card input:checked + .auth-type-card__box .auth-type-card__icon {
    background: var(--gludo-primary);
    color: #fff;
}

.auth-type-card__title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gludo-text);
    line-height: 1.35;
}

.auth-type-card__desc {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--gludo-muted);
}

.auth-type-card__text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-alert {
    border-radius: calc(var(--gludo-radius) - 2px);
    padding: 0.9rem 1rem;
    margin-bottom: 1.25rem;
}

.auth-alert--error {
    background: color-mix(in srgb, #c0392b 10%, var(--gludo-surface));
    border: 1px solid color-mix(in srgb, #c0392b 35%, var(--gludo-border));
    color: var(--gludo-text);
}

.auth-alert--success {
    background: color-mix(in srgb, var(--gludo-primary) 10%, var(--gludo-surface));
    border: 1px solid color-mix(in srgb, var(--gludo-primary) 35%, var(--gludo-border));
}

.auth-alert__list {
    margin: 0;
    padding-inline-start: 1.1rem;
}

.auth-alert__action {
    margin: 0.75rem 0 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-form__label {
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-form__control {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 0.5rem;
    background: var(--gludo-surface);
    color: var(--gludo-text);
    font: inherit;
    padding: 0.75rem 0.85rem;
    min-height: 3.125rem;
    line-height: 1.5;
}

.auth-form__control:focus {
    outline: 2px solid color-mix(in srgb, var(--gludo-primary) 35%, transparent);
    border-color: var(--gludo-primary);
}

.auth-form__password {
    position: relative;
}

.auth-form__password .auth-form__control {
    padding-inline-end: 2.75rem;
}

.auth-form__toggle {
    position: absolute;
    inset-inline-end: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--gludo-muted);
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
}

.auth-form__toggle:hover {
    color: var(--gludo-text);
}

.auth-form__hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--gludo-muted);
}

.auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-form__link {
    font-size: 0.92rem;
    color: var(--gludo-primary, #2563eb);
    text-decoration: none;
}

.auth-form__link:hover {
    text-decoration: underline;
}

.auth-form__check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    cursor: pointer;
}

.auth-form__actions {
    margin-top: 0.25rem;
}

.auth-form__submit {
    width: 100%;
}

.auth-form__submit.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.auth-form__footer {
    margin: 0;
    text-align: center;
    color: var(--gludo-muted);
    font-size: 0.95rem;
}

.auth-page__footer {
    margin: 1.35rem 0 0;
    text-align: center;
    color: var(--gludo-muted);
    font-size: 0.95rem;
}

.auth-form__footer a,
.auth-page__footer a {
    color: var(--gludo-primary);
    font-weight: 600;
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.auth-social__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.75rem;
    border-radius: calc(var(--gludo-radius) - 2px);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.auth-social__btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.auth-social__btn--google {
    background: #1f8f45;
    color: #fff;
}

.auth-social__btn--facebook {
    background: #1877f2;
    color: #fff;
}

.auth-social__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    color: var(--gludo-muted);
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gludo-border);
}

.auth-otp__title {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
}

.auth-otp__intro,
.auth-otp__hint {
    margin: 0 0 0.75rem;
    color: var(--gludo-muted);
    line-height: 1.6;
}

.auth-otp__resend {
    margin-bottom: 1rem;
}

.auth-otp__inputs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.auth-otp__digit {
    width: 2.75rem;
    height: 3rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border: 1px solid var(--gludo-border);
    border-radius: calc(var(--gludo-radius) - 2px);
    background: var(--gludo-surface);
    color: var(--gludo-text);
}

.auth-otp__digit:focus {
    outline: 2px solid color-mix(in srgb, var(--gludo-primary) 35%, transparent);
    border-color: var(--gludo-primary);
}

.site-header__user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-header__user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gludo-text);
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-header__logout-form {
    margin: 0;
}

@media (max-width: 640px) {
    .auth-panel {
        padding: 1.1rem;
    }

    .auth-type-picker__grid {
        grid-template-columns: 1fr;
    }

    .auth-type-card__box {
        flex-direction: row;
        align-items: flex-start;
        text-align: start;
        gap: 0.85rem;
        padding: 0.9rem 1rem;
    }

    .auth-type-card__text {
        align-items: flex-start;
    }

    .auth-type-card__icon {
        flex-shrink: 0;
    }

    .auth-otp__digit {
        width: 2.35rem;
        height: 2.75rem;
    }
}

.auth-page .select2-container {
    width: 100% !important;
}

.auth-page--complete-profile {
    --auth-field-h: 3.125rem;
    --auth-field-px: 0.85rem;
    --auth-field-border: 1px solid #d0d5dd;
    --auth-field-radius: 0.5rem;
    --auth-field-bg: var(--gludo-surface, #fff);
}

.auth-page--complete-profile .auth-form__input {
    width: 100%;
}

.auth-page--complete-profile .auth-form__input .select2-container--default .select2-selection--single {
    height: var(--auth-field-h);
    min-height: var(--auth-field-h);
    border: var(--auth-field-border);
    border-radius: var(--auth-field-radius);
    background: var(--auth-field-bg);
    font: inherit;
    padding: 0 var(--auth-field-px);
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.auth-page--complete-profile .auth-form__input .select2-container--default.select2-container--focus .select2-selection--single,
.auth-page--complete-profile .auth-form__input .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--gludo-primary);
    outline: 2px solid color-mix(in srgb, var(--gludo-primary) 35%, transparent);
    outline-offset: 0;
}

.auth-page--complete-profile .auth-form__input .select2-container--default .select2-selection__rendered {
    padding: 0;
    padding-inline-end: 1.75rem;
    line-height: calc(var(--auth-field-h) - 2px);
    color: inherit;
}

.auth-page--complete-profile .auth-form__input .select2-container--default .select2-selection__placeholder {
    color: var(--gludo-muted, #64748b);
}

.auth-page--complete-profile .auth-form__input .select2-container--default .select2-selection__arrow {
    height: 100%;
    top: 0;
    width: 2rem;
}

.auth-page--complete-profile .auth-form__input .phone-field .iti {
    width: 100%;
    display: block;
}

.auth-page--complete-profile .auth-form__input .phone-field .iti .iti__country-container,
.auth-page--complete-profile .auth-form__input .phone-field .iti .iti__selected-country {
    height: var(--auth-field-h);
}

.auth-page--complete-profile .auth-form__input .phone-field .iti input[type="tel"],
.auth-page--complete-profile .auth-form__input .phone-field .iti .iti__tel-input {
    height: var(--auth-field-h);
    min-height: var(--auth-field-h);
    padding-left: 52px;
    padding-right: var(--auth-field-px);
    border: var(--auth-field-border);
    border-radius: var(--auth-field-radius);
    background: var(--auth-field-bg);
    font: inherit;
    line-height: calc(var(--auth-field-h) - 2px);
    color: inherit;
}

.auth-page--complete-profile .auth-form__input .phone-field .iti input[type="tel"]:focus,
.auth-page--complete-profile .auth-form__input .phone-field .iti .iti__tel-input:focus {
    outline: 2px solid color-mix(in srgb, var(--gludo-primary) 35%, transparent);
    border-color: var(--gludo-primary);
}

.auth-page--complete-profile .auth-form__static {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: var(--auth-field-h);
    justify-content: center;
    padding: 0 var(--auth-field-px);
    border: var(--auth-field-border);
    border-radius: var(--auth-field-radius);
    background: #f8fafc;
    box-sizing: border-box;
}

.auth-page--complete-profile .auth-form__static strong {
    font-size: 0.95rem;
    color: var(--gludo-text);
}

.auth-page--complete-profile .auth-form__static span {
    font-size: 0.85rem;
    color: var(--gludo-muted);
    line-height: 1.45;
}

.auth-page .select2-container--default .select2-selection--single {
    min-height: 3.125rem;
    height: auto;
    border: 1px solid #d0d5dd;
    border-radius: 0.5rem;
    font: inherit;
    padding: 0.375rem 0.85rem;
    display: flex;
    align-items: center;
    background: var(--gludo-surface);
}

.auth-page .select2-container--default.select2-container--focus .select2-selection--single,
.auth-page .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--gludo-primary);
    outline: 2px solid color-mix(in srgb, var(--gludo-primary) 35%, transparent);
}

.auth-page .select2-container--default .select2-selection__rendered {
    padding-inline-start: 0;
    padding-inline-end: 1.75rem;
    line-height: 1.5;
    color: inherit;
}

.auth-page .select2-container--default .select2-selection__arrow {
    height: 100%;
    top: 0;
}

.auth-page .select2-dropdown {
    border-color: #d0d5dd;
    border-radius: 0.5rem;
    overflow: hidden;
    z-index: 10050;
}

.auth-page .select2-search__field {
    border: 1px solid #d0d5dd !important;
    border-radius: 0.375rem !important;
    font: inherit;
}

.auth-page .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--gludo-primary, #0358b8);
}

.auth-type-card--readonly {
    display: block;
    padding: 0.85rem 1rem;
    border: 1px solid #e5eaef;
    border-radius: 0.75rem;
    background: #f8fafc;
    margin: 0;
}
