.auth-portal {
    --auth-surface: #ffffff;
    --auth-surface-alt: #f3f7fa;
    --auth-border: rgba(0, 101, 143, 0.14);
    --auth-border-strong: rgba(0, 101, 143, 0.24);
    --auth-primary: var(--md-primary);
    --auth-primary-hover: #00567a;
    --auth-text: var(--md-on-surface);
    --auth-text-soft: var(--md-on-surface-variant);
    --auth-shadow: 0 24px 60px rgba(0, 43, 61, 0.12);
}

.auth-portal-page {
    padding: 56px 0 84px;
}

.auth-portal-grid {
    display: grid;
    gap: 28px;
    align-items: stretch;
    justify-content: center;
}

.auth-portal-card {
    min-width: 0;
    border: 1px solid var(--auth-border);
    border-radius: 28px;
    box-shadow: var(--auth-shadow);
}
.auth-portal-card h1 {
    margin: 0;
    letter-spacing: -0.04em;
    line-height: 1.04;
}

.auth-portal-card {
    padding: 32px;
    background: var(--auth-surface);
    width: min(100%, 680px);
    margin-inline: auto;
}

.auth-portal-card__header {
    margin-bottom: 22px;
}

.auth-portal-card__header h1 {
    font-size: clamp(1.95rem, 3vw, 2.75rem);
}

.auth-portal-card__header p {
    margin: 12px 0 0;
    color: var(--auth-text-soft);
    line-height: 1.65;
}

.auth-portal-card .ajax_response {
    margin-bottom: 16px;
}

.auth-portal-card .ajax_response:focus {
    outline: none;
}

.auth-portal-card .ajax_response:empty {
    display: none;
}

.auth-activation-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -4px 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--auth-surface-alt);
}

.auth-activation-action[hidden] {
    display: none;
}

.auth-activation-action p {
    margin: 0;
    color: var(--auth-text-soft);
    font-weight: 700;
}

.auth-activation-action .button {
    flex: 0 0 auto;
    justify-content: center;
}

.auth-portal-card .ajax_response .message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid transparent;
    border-radius: 18px;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.55;
    box-shadow: 0 14px 32px rgba(0, 43, 61, 0.08);
}

.auth-portal-card .ajax_response .message::before {
    display: inline-grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-family: "Font Awesome 5 Free";
    font-size: 0.88rem;
    font-weight: 900;
}

.auth-portal-card .ajax_response .message.success {
    color: #0b5132;
    background: #e8f7ef;
    border-color: #9fd8b6;
}

.auth-portal-card .ajax_response .message.success::before {
    content: "\f00c";
    color: #fff;
    background: #1f8f57;
}

.auth-portal-card .ajax_response .message.info {
    color: #0d4f78;
    background: #e8f4fb;
    border-color: #98cceb;
}

.auth-portal-card .ajax_response .message.info::before {
    content: "\f129";
    color: #fff;
    background: #1b79b8;
}

.auth-portal-card .ajax_response .message.warning {
    color: #7a4b00;
    background: #fff4dc;
    border-color: #f2cd78;
}

.auth-portal-card .ajax_response .message.warning::before {
    content: "\f071";
    color: #fff;
    background: #d28a00;
}

.auth-portal-card .ajax_response .message.error {
    color: #7d1f27;
    background: #fdecee;
    border-color: #efb2ba;
}

.auth-portal-card .ajax_response .message.error::before {
    content: "\f06a";
    color: #fff;
    background: #d64555;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.auth-stepper__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #d8dde0;
    border-radius: 18px;
    background: var(--auth-surface-alt);
    color: var(--auth-text-soft);
    transition: border-color var(--motion-fast) var(--motion-standard), background-color var(--motion-fast) var(--motion-standard), color var(--motion-fast) var(--motion-standard);
}

.auth-stepper__item.is-active {
    border-color: var(--auth-primary);
    background: var(--md-primary-container);
    color: var(--auth-text);
}

.auth-stepper__item.is-complete {
    border-color: rgba(20, 164, 77, 0.28);
    background: rgba(20, 164, 77, 0.1);
    color: var(--auth-text);
}

.auth-stepper__number {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--auth-primary);
    font-weight: 800;
}

.auth-stepper__label {
    font-weight: 700;
}

.auth-form-grid {
    display: grid;
    gap: 16px;
}

.auth-register-step {
    display: none;
    gap: 18px;
}

.auth-register-step.is-active {
    display: grid;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field > span {
    font-weight: 700;
    color: var(--auth-text);
}

.auth-field input,
.auth-field select {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid var(--auth-border);
    border-radius: 18px;
    background: #fff;
    color: var(--auth-text);
    transition: border-color var(--motion-fast) var(--motion-standard), box-shadow var(--motion-fast) var(--motion-standard);
}

.auth-field input::placeholder {
    color: #83919a;
}

.auth-field select {
    padding-right: 46px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--auth-text-soft) 50%), linear-gradient(135deg, var(--auth-text-soft) 50%, transparent 50%);
    background-position: calc(100% - 24px) calc(50% - 3px), calc(100% - 18px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.auth-field input:focus,
.auth-field select:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(0, 101, 143, 0.12);
    outline: none;
}

.auth-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--auth-text-soft);
    font-weight: 600;
}

.auth-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-primary);
}

.auth-link,
.auth-form-meta a,
.auth-footnote a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-link:hover,
.auth-form-meta a:hover,
.auth-footnote a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    border: 0;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(0, 101, 143, 0.2);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--auth-text-soft);
    font-size: 0.92rem;
    font-weight: 700;
}

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

.auth-socials {
    display: grid;
    gap: 12px;
}

.auth-social {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 0 18px;
    border: 1px solid var(--auth-border);
    border-radius: 18px;
    background: var(--auth-surface-alt);
    color: var(--auth-text);
    font-weight: 700;
    transition: transform var(--motion-fast) var(--motion-standard), border-color var(--motion-fast) var(--motion-standard), box-shadow var(--motion-fast) var(--motion-standard), background-color var(--motion-fast) var(--motion-standard);
}

.auth-social:hover {
    border-color: var(--auth-border-strong);
    background: #fff;
    box-shadow: 0 14px 28px rgba(0, 43, 61, 0.08);
    transform: translateY(-1px);
}

.auth-social i {
    width: 24px;
    text-align: center;
    font-size: 1.12rem;
}

.auth-social__google {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.auth-social .auth-social__microsoft {
    display: grid;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
}

.auth-social__microsoft > span:nth-child(1) {
    background: #f25022;
}

.auth-social__microsoft > span:nth-child(2) {
    background: #7fba00;
}

.auth-social__microsoft > span:nth-child(3) {
    background: #00a4ef;
}

.auth-social__microsoft > span:nth-child(4) {
    background: #ffb900;
}

.auth-social span {
    display: block;
}

.auth-social small {
    display: block;
    margin-top: 2px;
    color: var(--auth-text-soft);
    font-size: 0.78rem;
    font-weight: 600;
}

.auth-helper {
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--md-primary-container);
    color: var(--auth-text-soft);
    line-height: 1.65;
}

.auth-helper strong {
    display: block;
    margin-bottom: 6px;
    color: var(--auth-text);
}

.auth-helper--neutral {
    background: var(--auth-surface-alt);
    border: 1px solid var(--auth-border);
}

.auth-form-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.auth-back {
    justify-content: center;
}

.auth-footnote {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--auth-text-soft);
    text-align: center;
}

.auth-verification {
    text-align: center;
}

.auth-verification__icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 20px;
    background: var(--md-primary-container);
    color: var(--auth-primary);
    font-size: 2rem;
}

.auth-verification--success .auth-verification__icon {
    background: #e8f7ef;
    color: #147344;
}

.auth-verification--attention .auth-verification__icon {
    background: #fff4dc;
    color: #9a6200;
}

.auth-verification .auth-helper {
    text-align: left;
}

.auth-verification__actions {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.auth-verification__actions .button {
    justify-content: center;
}

@media (min-width: 992px) {
    .auth-form-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .auth-portal-page {
        padding: 32px 0 64px;
    }

    .auth-portal-card {
        padding: 26px 22px;
        border-radius: 24px;
    }
}

@media (max-width: 575.98px) {
    .auth-portal-card {
        padding: 22px 18px;
    }

    .auth-form-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-activation-action {
        align-items: stretch;
        flex-direction: column;
    }
}
