:root {
    --ac-primary: #3a7bff;
    --ac-secondary: #4aa8ff;
    --ac-accent: #5ed6a5;
    --ac-text-primary: #1f2a37;
    --ac-text-secondary: #6b7280;
    --ac-bg-page: #f5f8fb;
}

.ac-auth-root {
    min-height: 100vh;
    margin: 0;
    /* Типографика как у остального приложения (Bootstrap 5 — переменная из lib/bootstrap) */
    font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 45%, #ecfeff 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;
    background: linear-gradient(135deg, var(--ac-primary) 0%, var(--ac-secondary) 50%, var(--ac-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(58, 123, 255, 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;
    background: linear-gradient(135deg, var(--ac-primary) 0%, var(--ac-secondary) 50%, var(--ac-accent) 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: var(--ac-text-secondary);
}

.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(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 2rem;
}

.ac-auth-tabs {
    display: flex;
    background: #f3f4f6;
    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 #e5e7eb;
    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: #cbd5e1;
}

.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 #e5e7eb;
    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:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.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 {
    outline: none;
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 3px rgba(58, 123, 255, 0.15);
}

.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-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: #d1d5db;
    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: var(--ac-secondary);
}

.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: #fff;
    background: linear-gradient(135deg, var(--ac-primary) 0%, var(--ac-secondary) 50%, var(--ac-accent) 100%);
    box-shadow: 0 10px 15px -3px rgba(58, 123, 255, 0.35);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ac-auth-btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -5px rgba(58, 123, 255, 0.4);
}

.ac-auth-btn-outline {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    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: #f9fafb;
}

.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 #e5e7eb;
}

.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 {
    text-decoration: underline;
}

.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: var(--ac-text-secondary);
}

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

.ac-auth-below-card a:hover {
    color: var(--ac-secondary);
}

.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: #dc3545;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    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;
}
