*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
}

/* Page shell */

.auth-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #123a6f 0%, #1c63b8 45%, #2f8ee0 100%);
    font-family: var(--font-sans, "Figtree", sans-serif);
}

.auth-page__wrap {
    width: 100%;
    max-width: 560px;
}

.auth-page__logo {
    display: inline-flex;
    margin-bottom: 37px;
}

.auth-page__logo-image {
    display: block;
    height: 72px;
    width: auto;
}

/* Card */

.auth-card {
    width: 100%;
    background: linear-gradient(180deg, #229fff 0%, #1e97fe 45%, #116ee7 100%);
    border-radius: 20px;
    box-shadow:
        0 20px 45px rgba(10, 30, 60, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    padding: 32px 36px 36px;
}

.auth-card__title {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.auth-card__description {
    margin: 0 0 30px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.5;
}

.auth-card__status {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.auth-card__status--success {
    color: #d7ffd9;
}

/* Form */

.auth-form {
    display: block;
}

.auth-form__group {
    margin-bottom: 22px;
}

.auth-form__label {
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* Numbered step header (number + title + hint), shown before an input */

.auth-form__step-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.auth-form__step-number {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ffd800;
    color: #14213d;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.auth-form__step-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 3px;
}

.auth-form__step-title {
    display: block;
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.auth-form__step-hint {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

.auth-form__input,
.auth-form__select {
    display: block;
    width: 100%;
    max-width: 624px;
    height: 51px;
    padding: 0 16px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background-color: #ffffff;
    color: #14213d;
    font-size: 15px;
    font-family: inherit;
    box-shadow: 0 6px 16px rgba(10, 30, 60, 0.15);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.auth-form__select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    appearance: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.auth-form__select:hover {
    box-shadow: 0 8px 20px rgba(10, 30, 60, 0.22);
}

/* Custom Alpine.js dropdown (replaces native <select> for company/department) */

[x-cloak] {
    display: none !important;
}

.auth-form__dropdown {
    position: relative;
    width: 100%;
    max-width: 624px;
}

.auth-form__dropdown-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-form__dropdown-arrow {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    transition: transform 0.15s ease;
}

.auth-form__dropdown-arrow--open {
    transform: rotate(180deg);
}

.auth-form__dropdown-list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(10, 30, 60, 0.3);
    max-height: 240px;
    overflow-y: auto;
}

.auth-form__dropdown-option {
    padding: 11px 14px;
    border-radius: 8px;
    color: #14213d;
    font-size: 15px;
    cursor: pointer;
    transition:
        background-color 0.12s ease,
        color 0.12s ease;
}

.auth-form__dropdown-option:hover {
    background-color: #eef5ff;
}

.auth-form__dropdown-option--active {
    background-color: #0e61de;
    color: #ffffff;
}

.auth-form__input::placeholder {
    color: #8a93a6;
}

.auth-form__input:hover,
.auth-form__select:hover {
    border-color: rgba(0, 87, 184, 0.25);
}

.auth-form__input:focus,
.auth-form__select:focus {
    outline: none;
    border-color: #ffd800;
    box-shadow: 0 0 0 3px rgba(255, 216, 0, 0.55);
}

/* Errors */

.auth-form__error {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.auth-form__error li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 8px;
    background-color: rgba(255, 77, 79, 0.16);
    color: #ffe9e9;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.auth-form__error li::before {
    content: "!";
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border-radius: 50%;
    background-color: #ff4d4f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

.auth-form__general-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background-color: rgba(255, 77, 79, 0.16);
    color: #ffe9e9;
    font-size: 14px;
    font-weight: 600;
}

.auth-form__general-error::before {
    content: "!";
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background-color: #ff4d4f;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

/* Checkbox / option row (used by "remember me") */

.auth-form__radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.auth-form__radio-label {
    color: #ffffff;
    font-size: 14px;
}

/* Checkbox */

.auth-form__checkbox {
    appearance: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.auth-form__checkbox:hover {
    border-color: #ffffff;
}

.auth-form__checkbox:checked {
    background-color: #ffd800;
    border-color: #ffd800;
}

.auth-form__checkbox:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #14213d;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-form__checkbox:focus-visible {
    outline: 2px solid #ffd800;
    outline-offset: 2px;
}

/* Avatar picker (gender) */

.auth-form__avatar-group {
    display: flex;
    gap: 32px;
    margin-top: 8px;
}

.auth-form__avatar-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.auth-form__avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-form__avatar-circle {
    display: flex;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 20px rgba(10, 30, 60, 0.25);
    background-color: rgba(255, 255, 255, 0.15);
    transition:
        border-color 0.15s ease,
        transform 0.15s ease;
}

.auth-form__avatar-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-form__avatar-option:hover .auth-form__avatar-circle {
    border-color: rgba(255, 216, 0, 0.7);
    transform: scale(1.02);
}

.auth-form__avatar-input:checked + .auth-form__avatar-circle {
    border-color: #ffd800;
    transform: scale(1.04);
}

.auth-form__avatar-input:focus-visible + .auth-form__avatar-circle {
    outline: 2px solid #ffd800;
    outline-offset: 3px;
}

.auth-form__avatar-label {
    margin-top: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* Actions */

.auth-form__actions {
    display: flex;
    align-items: center;
    /* justify-content: flex-end; */
    gap: 24px;
    margin-top: 34px;
}

.auth-form__actions--split {
    justify-content: space-between;
}

.auth-form__link {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.auth-form__link:hover {
    color: #ffd800;
}

.auth-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;

    border-radius: 12px;
    background-color: #ffd800;
    color: #0e61de;
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(10, 30, 60, 0.25);
    transition:
        background-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.auth-form__submit:hover {
    background-color: #f0c400;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(10, 30, 60, 0.3);
}

.auth-form__submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(10, 30, 60, 0.25);
}

/* Auth pages reuse the welcome page's white frame (.page__card) but need a
   narrower cap so the form doesn't stretch edge-to-edge on wide screens. */
.page__card:has(.auth-card) {
    max-width: 840px;
}

/* Responsive */

@media (max-width: 640px) {
    .auth-page {
        padding: 16px;
    }

    .auth-card {
        padding: 24px 20px 28px;
    }

    .auth-card__title {
        font-size: 24px;
    }

    .auth-form__actions {
        flex-wrap: wrap;
    }

    .auth-form__submit {
        width: 100%;
    }

    .auth-form__avatar-group {
        gap: 20px;
    }

    .auth-form__avatar-circle {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 380px) {
    .auth-form__avatar-group {
        gap: 14px;
    }

    .auth-form__avatar-circle {
        width: 84px;
        height: 84px;
    }
}
