/* ====================================================
   Elder Aid
   Login Page
==================================================== */

.login-page {

    display: grid;
    grid-template-columns: 60% 40%;

    width: 100vw;
    height: 100vh;

}

.login-image {

    background-color: #d9d9d9;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;

}

.login-panel {

    background: var(--surface);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 2rem;

}

#loginForm {

    width: 100%;
    max-width: 380px;

    display: flex;
    flex-direction: column;

}

#logoImage {

    width: 100px;
    height: 100px;

    margin: 0 auto 1rem;

    object-fit: contain;

}

#loginForm h1 {

    text-align: center;
    margin: 0;

}

.subtitle {

    text-align: center;

    color: var(--text-light);

    margin: .5rem 0 2rem;

}

/* ====================================================
   Floating Labels
==================================================== */

.form-group {

    position: relative;

}

/* ====================================================
   Password
==================================================== */

.password-container {

    position: relative;

}

.password-container input {

    padding-right: 50px;

}

#togglePassword {

    position: absolute;

    top: 50%;
    right: 6px;

    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;

    transform: translateY(-50%);

    border: none;
    background: transparent;

    cursor: pointer;

    color: var(--text-light);

    font-size: 1rem;

}

.password-container input:invalid ~ #togglePassword {

    display: none;

}

#togglePassword:focus-visible,
.links a:focus-visible {

    outline: 3px solid #173d2a;
    outline-offset: 3px;

}

/* ====================================================
   Errors
==================================================== */

.input-error {
    margin: 6px 0 12px;
}

.input-invalid {

    border-color: #dc2626 !important;

}

.input-invalid + label {

    color: #dc2626 !important;

}

.login-form-status {
    margin-bottom: .75rem;
}

/* ====================================================
   Login Button
==================================================== */

#loginButton {

    margin-top: .5rem;

}

#loginButton:disabled {

    cursor: wait;

    opacity: .9;

}

.oauth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-size: .78rem;
}

.oauth-divider::before,
.oauth-divider::after {
    height: 1px;
    background: var(--border);
    content: "";
}

.google-login-button {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.google-login-button:hover {
    background: var(--surface-subtle, var(--background));
}

.google-login-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
    outline-offset: 2px;
}

.google-login-button:disabled {
    cursor: wait;
    opacity: .7;
}

.oauth-divider[hidden],
.google-login-button[hidden] {
    display: none;
}

/* ====================================================
   Links
==================================================== */

.links {

    display: flex;

    justify-content: space-between;

    margin-top: 1rem;

}

.links .login-link {

    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);

    text-decoration: none;

    font: inherit;
    font-size: .9rem;
    cursor: pointer;

}

.links .login-link:hover {

    text-decoration: underline;

}

.login-dialog-form h2,
.login-dialog-form p {
    margin: 0;
}

.login-dialog-form .ea-dialog__header p {
    max-width: 56ch;
    margin-top: 6px;
    color: var(--text-light);
    font-size: .82rem;
    line-height: 1.5;
}

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

.login-dialog-grid label,
.login-dialog-field {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: .78rem;
    font-weight: 600;
}

.login-dialog-wide {
    grid-column: 1 / -1;
}

.login-dialog input,
.login-dialog textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

.login-dialog textarea {
    min-height: 108px;
}

.login-dialog input:focus,
.login-dialog textarea:focus {
    border-color: var(--primary);
    outline: 3px solid color-mix(in srgb, var(--primary) 18%, transparent);
}

.login-dialog-status {
    min-height: 1.35rem;
    margin-top: 14px !important;
    font-size: .75rem;
    line-height: 1.45;
}

.login-dialog-status[data-state="success"] {
    color: var(--success-text, #166534);
}

.login-dialog-status[data-state="error"] {
    color: var(--danger-text, #b4232c);
}

/* ====================================================
   Responsive
==================================================== */

@media (max-width:1024px){

    .login-page{

        display:block;

    }

    .login-image{

        display:none;

    }

    .login-panel{

        min-height:100vh;

        padding:3rem;

    }

    #loginForm{

        max-width:520px;

        margin:auto;

    }

}

@media (max-width:768px){

    .login-panel{

        padding:1.5rem;

    }

    #logoImage{

        width:80px;
        height:80px;

    }

}

@media (max-width:560px) {
    .login-dialog-grid {
        grid-template-columns: 1fr;
    }

    .login-dialog-wide {
        grid-column: auto;
    }
}

/* ====================================================
   Hide Edge Password Button
==================================================== */

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear{

    display:none;

}

.session-notice {
    margin: -1rem 0 1.25rem;
    padding: .75rem .9rem;
    border: 1px solid #f0c36d;
    border-radius: var(--radius);
    background: #fff8e7;
    color: #7a5310;
    font-size: .85rem;
    line-height: 1.45;
}

#passwordUpdateForm {
    width: 100%;
    max-width: 420px;
    display: grid;
    gap: 14px;
}

#passwordUpdateForm h1,
#passwordUpdateForm .subtitle {
    text-align: left;
}

#passwordUpdateForm .subtitle {
    margin: -6px 0 8px;
}

.reset-password-help {
    margin-top: -8px;
    color: var(--text-light);
    font-size: .8rem;
    line-height: 1.45;
}

.reset-login-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: .84rem;
}
