.auth,
.auth * {
    box-sizing: border-box;
}

.auth {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
    overflow: hidden;
    font-family: var(--font);
    color: var(--ink);
    background: #f6f8fc;
    isolation: isolate;
}

    /* 2 vệt sáng xanh mờ ở góc */
    .auth::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: radial-gradient(640px 420px at 10% 6%, rgba(31, 94, 234, 0.16), transparent 65%), radial-gradient(720px 520px at 92% 100%, rgba(59, 124, 247, 0.18), transparent 65%);
    }

    /* lưới nhạt, mờ dần ra rìa */
    .auth::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background-image: linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
        background-size: 32px 32px;
        -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7), transparent 75%);
        mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7), transparent 75%);
    }

.auth-wrap {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    padding: 40px 36px 32px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 48px -24px rgba(15, 23, 42, 0.18);
    animation: auth-in 0.35s ease-out both;
}

@keyframes auth-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Thương hiệu + tiêu đề ---------- */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    text-align: center;
}

.auth-brand__mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
    border-radius: 14px;
    box-shadow: 0 10px 20px -10px rgba(31, 94, 234, 0.8);
}

.auth-brand__name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.auth-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--blue-900);
}

.auth-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    color: var(--muted);
}

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    border-radius: 10px;
}

/* ---------- Ô nhập ---------- */
.auth-field {
    margin-bottom: 16px;
}

    .auth-field label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 600;
        color: var(--ink-2);
    }

.auth-control {
    position: relative;
}

    .auth-control > i {
        position: absolute;
        top: 50%;
        left: 14px;
        font-size: 18px;
        color: #94a3b8;
        transform: translateY(-50%);
        pointer-events: none;
        transition: color 0.15s;
    }

    .auth-control:focus-within > i {
        color: var(--blue-600);
    }

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input--password {
    padding-right: 48px;
}

.auth-input::placeholder {
    color: #a3aebf;
}

.auth-input:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: var(--ring);
}

/*class .valid/.invalid/.modified – tắt outline mặc định của template */
.auth .auth-input.valid.modified,
.auth .auth-input.invalid {
    outline: none;
}

.auth .auth-input.invalid {
    border-color: var(--danger);
}

.auth-field .validation-message {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--danger);
}

/* nút hiện / ẩn mật khẩu */
.auth-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: 0;
    border-radius: 8px;
    transform: translateY(-50%);
}

    .auth-eye:hover {
        color: var(--blue-600);
        background: var(--blue-50);
    }

/* ---------- Hàng ghi nhớ / quên mật khẩu ---------- */
.auth-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 22px;
    font-size: 14px;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    cursor: pointer;
}

    .auth-check input {
        width: 16px;
        height: 16px;
        accent-color: var(--blue-600);
    }

.auth-link {
    font-weight: 600;
    color: var(--blue-600);
    text-decoration: none;
}

    .auth-link:hover {
        text-decoration: underline;
    }

/* ---------- Nút chính ---------- */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background: var(--blue-600);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 10px 22px -12px rgba(31, 94, 234, 0.7);
    transition: background 0.15s, transform 0.05s;
}

    .auth-btn:hover {
        color: #fff;
        background: var(--blue-700);
    }

    .auth-btn:active {
        transform: translateY(1px);
    }

    .auth-btn:focus-visible {
        outline: none;
        box-shadow: var(--ring);
    }

/* ---------- Phần dưới ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 12px;
    font-size: 12px;
    color: var(--muted);
}

    .auth-divider::before,
    .auth-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--line);
    }

.auth-help {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    color: var(--muted);
}

.auth-foot {
    margin: 20px 0 0;
    font-size: 12px;
    text-align: center;
    color: var(--muted);
}

.auth--flat::after {
    display: none;
}

.auth--flat .auth-card {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    .auth {
        padding: 16px;
        align-items: start;
        padding-top: 40px;
    }

    .auth-card {
        padding: 28px 22px 24px;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }

    .auth-input,
    .auth-btn,
    .auth-control > i {
        transition: none;
    }
}

/* ---------- Giao diện báo lỗi validation của form Đăng nhập/ xác thực ---------- */
.auth .input-validation-error {
    border-color: var(--danger);
}

.auth .field-validation-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--danger);
}

.auth .validation-summary-valid {
    display: none;
}

.auth .validation-summary-errors ul {
    padding-left: 18px;
    margin: 0;
}
