/* Цвета — литералы Ac.Web/wwwroot/scss/_ac-colors.scss (общей сборки нет). Градиент лаунчера не менять. */
:root {
    --ac-primary: #5c67bc /* $ac-brand-600 */;
    --ac-secondary: #7fa0ee /* $ac-brand-400 */;
    --ac-accent: #20a339 /* $ac-status-success */;
    --ac-text-primary: #18181b /* $ac-neutral-800 */;
    --ac-text-secondary: #71717a /* $ac-neutral-400 */;
    --ac-bg-page: #f5f8fe; /* $ac-brand-50 */
    /* PRODUCT LAUNCHER — SYNC с Ac.Web/_ac-colors.scss $ac-launcher-* и Loader/dom.ts */
    --ac-launcher-stop-1: #3A7BFF;
    --ac-launcher-stop-2: #4AA8FF;
    --ac-launcher-stop-3: #975ed6;
    --ac-launcher-bg: linear-gradient(135deg, var(--ac-launcher-stop-1) 0%, var(--ac-launcher-stop-2) 50%, var(--ac-launcher-stop-3) 100%);
    --ac-launcher-icon-color: #fff;
}

.ac-auth-root {
    min-height: 100vh;
    margin: 0;
    /* Inter: @font-face в scss/app.css, файлы wwwroot/font/inter/ */
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    /* $ac-brand-50 → $ac-brand-100 → $ac-brand-200 */
    background: linear-gradient(135deg, #f5f8fe 0%, #e8f0fc 45%, #cddefc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.ac-auth-root ::-webkit-scrollbar {
    display: none;
}

.ac-auth-container {
    width: 100%;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.ac-auth-container--wide {
    max-width: 32rem;
}

.ac-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ac-auth-brand-row {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ac-auth-logo-mark {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    /* Белый кант знака на brand-400 и солиде success ниже 3:1.
       $ac-brand-800 → $ac-brand-700 → $ac-status-success-text */
    background: linear-gradient(135deg, #273d7a 0%, #324f9f 48%, #166534 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(92, 103, 188, 0.35);
    color: #fff;
    font-size: 1.35rem;
}

.ac-auth-logo-image {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: contain;
}

.ac-auth-brand-text {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    /* На wash brand-200: brand-600 = 3.75, brand-400 и солид success ниже 4.5:1.
       $ac-brand-900 → $ac-brand-700 → $ac-status-success-text */
    background: linear-gradient(135deg, #1c2d5a 0%, #324f9f 52%, #166534 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ac-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ac-text-primary);
    margin: 0 0 0.5rem;
}

.ac-auth-subtitle {
    margin: 0;
    font-size: 1rem;
    color: #52525b; /* $ac-neutral-500 — neutral-400 на brand-200 ниже 4.5:1 */
}

.ac-auth-card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(24, 24, 27, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 2rem;
}

.ac-auth-tabs {
    display: flex;
    background: #f4f4f5;
    border-radius: 1rem;
    padding: 0.25rem;
    margin-bottom: 2rem;
    gap: 0.25rem;
}

.ac-auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    background: transparent;
    color: var(--ac-text-secondary);
    text-decoration: none;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.ac-auth-tab:hover {
    color: var(--ac-text-primary);
}

.ac-auth-tab--active {
    background: #fff;
    color: var(--ac-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ac-auth-field {
    margin-bottom: 1.25rem;
}

.ac-auth-field:last-of-type {
    margin-bottom: 0;
}

.ac-auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-text-primary);
    margin-bottom: 0.5rem;
}

.ac-auth-input-wrap {
    position: relative;
}

.ac-auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ac-text-secondary);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.ac-auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1rem 1rem 2.75rem;
    font-size: 0.875rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    background: #fff;
    color: var(--ac-text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ac-auth-input-wrap--password .ac-auth-input {
    padding-right: 2.75rem;
}

.ac-auth-input-otp {
    font-size: 2rem;
    font-family: var(--bs-font-monospace, ui-monospace, "Cascadia Code", "SFMono-Regular", monospace);
    letter-spacing: 0.5em;
    text-align: center;
    padding-left: 2.75rem;
    padding-right: 1rem;
}

.ac-auth-input-otp::placeholder {
    letter-spacing: 0.5em;
    color: #d4d4d8;
}

.ac-auth-inn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.ac-auth-input-wrap--inn {
    flex: 1 1 10rem;
    min-width: 0;
}

.ac-auth-btn-check-inn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0 1rem;
    min-height: 3.25rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-primary);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.ac-auth-btn-check-inn:hover:not(:disabled) {
    background: var(--ac-primary);
    border-color: var(--ac-primary);
    color: #fff;
}

.ac-auth-btn-check-inn:focus-visible {
    outline: 2px solid #324f9f; /* $ac-brand-700 */
    outline-offset: 2px;
}

.ac-auth-btn-check-inn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ac-auth-company-panel {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #cddefc;
    background: #f5f8fe;
}

.ac-auth-company-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-text-primary);
}

.ac-auth-company-title-row .bi {
    color: var(--ac-primary);
}

.ac-auth-company-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.ac-auth-company-details {
    font-size: 0.875rem;
    color: var(--ac-text-secondary);
    line-height: 1.5;
}

.ac-auth-company-details strong {
    color: var(--ac-text-primary);
    font-weight: 600;
}

.ac-auth-input:focus {
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 3px rgba(92, 103, 188, 0.28);
    outline: 2px solid #324f9f; /* $ac-brand-700 */
    outline-offset: 2px;
}

.ac-auth-input-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--ac-text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
    line-height: 1;
}

.ac-auth-input-toggle:hover {
    color: var(--ac-text-primary);
}

.ac-auth-input-toggle:focus-visible {
    outline: 2px solid #324f9f; /* $ac-brand-700 */
    outline-offset: 2px;
}

.ac-auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ac-auth-remember {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    margin: 0;
    font-size: 0.875rem;
    color: var(--ac-text-secondary);
}

.ac-auth-remember:hover {
    color: var(--ac-text-primary);
}

.ac-auth-remember .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0;
    border-width: 2px;
    border-color: #d4d4d8;
    cursor: pointer;
}

.ac-auth-remember .form-check-input:checked {
    background-color: var(--ac-primary);
    border-color: var(--ac-primary);
}

.ac-auth-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ac-primary);
    text-decoration: none;
}

.ac-auth-link:hover {
    color: #324f9f; /* $ac-brand-700 — brand-400 на белом ниже 4.5:1 */
}

.ac-auth-link:focus-visible,
.ac-auth-tab:focus-visible {
    outline: 2px solid #324f9f; /* $ac-brand-700 */
    outline-offset: 2px;
}

.ac-auth-btn-gradient {
    width: 100%;
    margin-top: 0.25rem;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-launcher-icon-color);
    /* Дефолт лаунчера виджета — токен --ac-launcher-bg (SYNC с Loader/dom.ts) */
    background: var(--ac-launcher-bg);
    box-shadow: 0 10px 15px -3px color-mix(in srgb, var(--ac-launcher-stop-1) 35%, transparent);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ac-auth-btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -5px color-mix(in srgb, var(--ac-launcher-stop-1) 40%, transparent);
}

.ac-auth-btn-gradient:focus-visible,
.ac-auth-btn-outline:focus-visible {
    outline: 2px solid #1c2d5a; /* $ac-brand-900 */
    outline-offset: 3px;
}

.ac-auth-btn-gradient:disabled,
.ac-auth-btn-outline:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.ac-auth-btn-outline {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-text-primary);
    background: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.ac-auth-btn-outline:hover {
    background: #fafafa;
}

.ac-auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

.ac-auth-divider::before,
.ac-auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e4e4e7;
}

.ac-auth-divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: var(--ac-text-secondary);
    background: rgba(255, 255, 255, 0.95);
}

.ac-auth-links {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
}

.ac-auth-links p {
    margin: 0.35rem 0;
}

.ac-auth-links a {
    color: var(--ac-primary);
    text-decoration: none;
    font-weight: 500;
}

.ac-auth-links a:hover {
    color: #324f9f; /* $ac-brand-700 */
    text-decoration: underline;
}

.ac-auth-links a:focus-visible,
.ac-auth-footer-note a:focus-visible,
.ac-auth-below-card a:focus-visible {
    outline: 2px solid #324f9f; /* $ac-brand-700 */
    outline-offset: 2px;
}

.ac-auth-footer-note {
    margin-top: 1rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--ac-text-secondary);
    text-align: center;
}

.ac-auth-footer-note a {
    color: var(--ac-primary);
    text-decoration: none;
}

.ac-auth-footer-note a:hover {
    text-decoration: underline;
}

.ac-auth-below-card {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #52525b; /* $ac-neutral-500 — на wash brand-200 */
}

.ac-auth-below-card a {
    font-weight: 500;
    color: #324f9f; /* $ac-brand-700 — brand-600 на brand-200 ниже 4.5:1 */
    text-decoration: none;
}

.ac-auth-below-card a:hover {
    color: #273d7a; /* $ac-brand-800 */
}

.ac-auth-external {
    margin-top: 0.5rem;
}

.ac-auth-external p {
    font-size: 0.8125rem;
    color: var(--ac-text-secondary);
    margin-bottom: 0.75rem;
}

.ac-auth-external .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.65rem 1rem;
}

.ac-auth-confirm-icon {
    text-align: center;
    font-size: 3rem;
    color: var(--ac-primary);
    margin-bottom: 1.25rem;
}

.ac-auth-confirm-text {
    font-size: 0.9375rem;
    color: var(--ac-text-secondary);
    line-height: 1.6;
    text-align: center;
    margin: 0 0 1.25rem;
}

.ac-auth-alert {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
}

.ac-auth-validation {
    font-size: 0.8125rem;
    margin-top: 0.35rem;
    color: #b91c1c; /* $ac-status-error-text */
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fef96c; /* $ac-status-warning */
    color: #18181b; /* $ac-neutral-800 */
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.ac-auth-root .validation-message {
    color: #b91c1c; /* $ac-status-error-text */
}

.ac-auth-root .invalid {
    outline-color: #b91c1c; /* $ac-status-error-text */
}

.ac-auth-root .valid.modified:not([type=checkbox]) {
    outline-color: #166534; /* $ac-status-success-text */
}

@media (prefers-reduced-motion: reduce) {
    .ac-auth-btn-gradient,
    .ac-auth-btn-outline,
    .ac-auth-btn-check-inn,
    .ac-auth-tab,
    .ac-auth-input {
        transition: none;
    }

    .ac-auth-btn-gradient:hover {
        transform: none;
    }
}
