:root {
    --cf-primary: #3949ab;
    --cf-card-width: 420px;
    --cf-radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    font-family: Roboto, "Noto Sans", Arial, sans-serif;
}

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

.auth-page {
    position: relative;
    min-height: 100vh;
    padding:
        max(20px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
    overflow: hidden;
    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.auth-theme-dark .auth-page {
    color: rgba(255, 255, 255, 0.92);
    background:
        radial-gradient(circle at 18% 10%, rgba(57, 73, 171, 0.34), transparent 32rem),
        linear-gradient(145deg, #0f1117 0%, #161922 54%, #101218 100%);
}

.auth-theme-light .auth-page {
    color: rgba(0, 0, 0, 0.87);
    background:
        radial-gradient(circle at 18% 10%, rgba(57, 73, 171, 0.14), transparent 32rem),
        linear-gradient(145deg, #f7f8fc 0%, #eef1f8 54%, #f8f9fc 100%);
}

.auth-toolbar {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-toolbar-select {
    width: 122px;
    margin: 0;
}

.auth-toolbar-select .md-errors-spacer {
    display: none;
}

.auth-content {
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(100%, var(--cf-card-width));
    margin: 44px 0 0;
    overflow: hidden;
    border-radius: var(--cf-radius);
}

.auth-theme-dark .auth-card {
    background: rgba(28, 31, 41, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.38),
        0 3px 12px rgba(0, 0, 0, 0.24);
}

.auth-theme-light .auth-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(25, 32, 74, 0.08);
    box-shadow:
        0 24px 70px rgba(40, 47, 80, 0.14),
        0 3px 12px rgba(40, 47, 80, 0.08);
}

.auth-card md-card-content {
    padding: 30px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 28px;
}

.auth-brand-mark {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    background: var(--cf-primary);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 2px;
    padding-left: 2px;
    box-shadow: 0 8px 24px rgba(57, 73, 171, 0.28);
}

.auth-product {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 500;
}

.auth-subtitle {
    margin-top: 3px;
    font-size: 14px;
    opacity: 0.68;
}

.auth-state {
    min-height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.auth-state-text {
    text-align: center;
    font-size: 14px;
    opacity: 0.75;
}

.auth-card md-input-container {
    margin: 9px 0;
}

.auth-password-toggle {
    position: absolute;
    right: -8px;
    bottom: 1px;
}

.auth-login-button {
    width: 100%;
    min-height: 44px;
    margin: 18px 0 0;
}

.auth-login-button md-progress-circular {
    margin: 0 auto;
}

.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 6px;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.45;
}

.auth-theme-dark .auth-error {
    color: #ffcdd2;
    background: rgba(183, 28, 28, 0.16);
}

.auth-theme-light .auth-error {
    color: #b71c1c;
    background: rgba(211, 47, 47, 0.08);
}

.auth-error md-icon {
    flex: 0 0 auto;
    font-size: 20px;
}

.auth-error-block {
    margin-top: 4px;
}

.auth-error-title {
    margin-bottom: 3px;
    font-weight: 500;
}

.auth-footer {
    margin-top: 20px;
    font-size: 12px;
    opacity: 0.48;
}

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

    .auth-toolbar {
        right: 7px;
    }

    .auth-card {
        margin-top: 56px;
        border-radius: 14px;
    }

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