@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/Inter-Variable.ttf") format("truetype");
}

* {
    box-sizing: border-box;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background:
        radial-gradient(circle at 50% -18%, rgba(37, 99, 235, .12), transparent 38%),
        #f4f7fb;
    color: #13223a;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.erp-app-credit {
    display: grid;
    justify-items: center;
    gap: 4px;
    width: 100%;
    max-width: 620px;
    padding: 0 16px;
    color: #8492a6;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.5;
    text-align: center;
}

.erp-app-owner { display: block; }
.erp-app-release,
.erp-app-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.erp-app-version,
.erp-app-links a { white-space: nowrap; }

.auth-shell {
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d8e4f2;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(11, 18, 32, .12);
}

.auth-shell.auth-wide {
    max-width: 620px;
}

.auth-accent {
    height: 5px;
    background: linear-gradient(90deg, #0b1220 0 72%, #2563eb 72% 100%);
}

.auth-content {
    padding: 32px;
}

.auth-brand {
    margin-bottom: 26px;
    text-align: center;
}

.auth-brand.auth-brand-compact {
    margin-bottom: 22px;
}

.auth-brand.auth-brand-compact .auth-product-logo {
    width: min(220px, 100%);
    margin-bottom: 15px;
}

.auth-product-logo {
    display: block;
    width: min(242px, 100%);
    height: auto;
    margin: 0 auto 18px;
    object-fit: contain;
}

.auth-company-name {
    max-width: 100%;
    margin: -4px 0 0;
    overflow: hidden;
    color: #5b6b82;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1.3;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-title {
    margin: 0 0 8px;
    color: #0b1220;
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.025em;
    text-align: center;
}

.auth-intro {
    margin: 0 0 24px;
    color: #65768d;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

.auth-intro strong {
    color: #243a56;
}

.auth-message {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
    text-align: center;
}

.auth-message.error {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #be123c;
}

.auth-message.success {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.auth-message.notice {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.auth-retry-countdown {
    display: block;
    margin-top: 5px;
    color: #9f1239;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.auth-field {
    margin-bottom: 16px;
    text-align: left;
}

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

.auth-account-meta {
    margin: 0 0 20px;
    padding: 12px 15px;
    border: 1px solid #dbe5ef;
    border-radius: 11px;
    background: #f8fafc;
}

.auth-account-meta div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
    font-size: 11px;
}

.auth-account-meta dt { color: #718096; }
.auth-account-meta dd { margin: 0; overflow-wrap: anywhere; color: #24344d; font-weight: 700; text-align: right; }

.erp-app-credit a {
    color: #607087;
    text-decoration: none;
}

.erp-app-credit a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.auth-label {
    display: block;
    margin-bottom: 7px;
    color: #53667f;
    font-size: 11px;
    font-weight: 700;
}

.auth-input-shell {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cad7e5;
    border-radius: 12px;
    outline: none;
    background: #f8fafc;
    color: #17243a;
    font: inherit;
    font-size: 14px;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.auth-input:focus,
.auth-otp-digit:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.auth-input.has-toggle {
    padding-right: 46px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #718096;
    cursor: pointer;
}

.auth-password-toggle:hover {
    background: #eef4f8;
    color: #27415f;
}

.auth-password-toggle svg {
    width: 18px;
    height: 18px;
}

.auth-primary {
    width: 100%;
    margin-top: 7px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    background: #0b1220;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.auth-primary:hover:not(:disabled) {
    background: #17233a;
}

.auth-primary:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.auth-spinner {
    display: none;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

.auth-primary.loading .auth-spinner {
    display: block;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-meta,
.auth-security-note,
.auth-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    color: #718096;
    font-size: 12px;
}

.auth-meta {
    margin-top: 18px;
}

.auth-security-note {
    margin-top: 22px;
}

.auth-link,
.auth-link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: #2563eb;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.auth-otp-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(34px, 1fr));
    gap: 8px;
    margin: 23px 0 13px;
}

.auth-otp-digit {
    width: 100%;
    min-width: 0;
    padding: 13px 3px;
    border: 1px solid #cad7e5;
    border-radius: 11px;
    outline: none;
    background: #f8fafc;
    color: #17243a;
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.auth-resend-row {
    justify-content: space-between;
    margin-bottom: 12px;
}

.auth-trust-device {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 16px;
    padding: 12px 13px;
    border: 1px solid #dbe5ef;
    border-radius: 11px;
    background: #f8fafc;
    color: #24344d;
    cursor: pointer;
}

.auth-trust-device input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #2563eb;
}

.auth-trust-device span {
    display: grid;
    gap: 3px;
}

.auth-trust-device strong {
    font-size: 12px;
    line-height: 1.3;
}

.auth-trust-device small {
    color: #718096;
    font-size: 10px;
    line-height: 1.4;
}

.auth-back-form {
    margin-top: 17px;
    text-align: center;
}

.auth-back-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: #53667f;
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.auth-hidden-form {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 520px) {
    body.auth-page {
        padding: 14px;
    }

    .auth-content {
        padding: 26px 22px;
    }

    .auth-product-logo {
        width: min(260px, 100%);
    }

    .auth-otp-grid {
        gap: 5px;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.erp-language-switcher-auth {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid #d7e1eb;
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.erp-language-switcher-auth .erp-language-icon {
    font-size: 13px;
    line-height: 1;
}

.erp-language-switcher-auth .erp-language-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.erp-language-switcher-auth select {
    height: 28px;
    padding: 0 24px 0 2px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #42536c;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 520px) {
    .erp-language-switcher-auth {
        top: 10px;
        right: 10px;
    }
}
