body {
    margin: 0;
    font-family: Roboto, "Helvetica Neue", sans-serif;
}

.email-password-change,
.forgot-password-container,
.login-container {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.email-password-change-form,
.forgot-password-form,
.login-form {
    display: flex;
    flex-direction: column;
    width: min(90vw, 20rem);
}

.info-msg {
    background: #d9f2d9;
    border: 1px solid #9cc59c;
    color: #215c2a;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ---- Material-ish text fields ---- */

.mat-form-field {
    display: inline-block;
    position: relative;
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.125;
    font-family: Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
}

.form-field {
    width: 100%;
    margin-bottom: 0.75rem;
}

.mat-form-field-wrapper {
    position: relative;
    width: 100%;
}

.mat-form-field-infix {
    display: block;
    position: relative;
    flex: auto;
    min-width: 0;
    padding: 0.25em 0 0.35em;
    border-top: 0.3em solid transparent;
}

.mat-input-element {
    box-sizing: border-box;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.25rem 0;
    font-size: 1rem;
}

.mat-form-field-underline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.1em;
    height: 1px;
    background-color: #bdbdbd;
    pointer-events: none;
}

.mat-form-field-ripple {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 150ms ease-out;
    background-color: #106535;
}

.mat-form-field.focused .mat-form-field-underline {
    background-color: transparent;
}

.mat-form-field.focused .mat-form-field-ripple {
    transform: scaleX(1);
}

.error-msg {
    color: #f44336;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.forgot-password-btn,
.login-reset-password {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3rem;
}

.email-password-change-form .login-reset-password {
    margin-top: 1rem;
}

.email-password-change-form .login-reset-password .mat-flat-button {
    margin-left: auto; /* Save button doprava */
}

.primary-color {
    color: #106535;
    text-decoration: none;
    font-size: 0.9rem;
}

.primary-color:hover {
    text-decoration: underline;
}

/* ---- Buttons ---- */

.mat-button,
.mat-flat-button {
    box-sizing: border-box;
    position: relative;
    user-select: none;
    cursor: pointer;
    outline: none;
    border: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    display: inline-block;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: baseline;
    text-align: center;
    margin: 0;
    min-width: 64px;
    line-height: 36px;
    padding: 0 16px;
    border-radius: 4px;
    overflow: visible;
    font-size: 0.9rem;
}

.mat-flat-button:not([class*=mat-elevation-z]) {
    box-shadow: 0 0 #0003, 0 0 #00000024, 0 0 #0000001f;
}

.mat-flat-button.mat-primary {
    background-color: #106535;
    color: #fff;
}

.mat-flat-button[disabled] {
    background-color: #e0e0e0;
    color: #9e9e9e;
    cursor: default;
    box-shadow: none;
}

.login-form h2 {
    margin-bottom: 1.5rem;
}

.mat-form-field.mat-focused .mat-form-field-underline {
    background-color: transparent;
}

.mat-form-field.mat-focused .mat-form-field-ripple {
    transform: scaleX(1);
}

.password-wrapper {
    display: flex;
    align-items: center;
}

.password-wrapper .mat-input-element {
    flex: 1;
}

.icon-button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0 0 0 0.4rem;
    display: flex;
    align-items: center;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: #424242;
}

.auth-block-ui {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: auto;
}

.auth-block-ui.hidden {
    display: none;
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    border-top-color: #106535;
    animation: auth-spin 0.8s linear infinite;
}

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

.mat-flat-button.loading {
    cursor: wait;
    opacity: 0.7;
}

.auth-form-loading .mat-input-element,
.auth-form-loading input {
    pointer-events: none;
}

#username:is(:-webkit-autofill, :autofill),
#password:is(:-webkit-autofill, :autofill) {
    --is-autofilled: 1;
}