/*
 * Authentication Pages Styles
 * Material 3 (M3) Expressive Implementation
*/

/* -- Main Authentication Card -- REFINED WITH ENTRANCE ANIMATION */
.auth-card {
    background-color: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-sys-shape-extra-large); /* 28px */
    box-shadow: var(--md-sys-elevation-level2);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    border: 1px solid var(--md-sys-color-outline-variant);

    /* --- NEW: ENTRANCE ANIMATION --- */
    /* Initial state before animation to prevent FOUC (Flash Of Unstyled Content) */
    opacity: 0;
    /* Apply the animation with specified delay and easing */
    animation: card-reveal 600ms var(--md-sys-motion-easing-emphasized-decelerate) 500ms forwards;
}

/* --- NEW: KEYFRAMES FOR THE ENTRANCE ANIMATION --- */
@keyframes card-reveal {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}


.auth-header {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Tighter gap */
    text-align: center;
}

/* -- Authentication Form Layout -- REFINED */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Increased gap */
}

.auth-footer {
    text-align: center;
    margin-top: 0; /* Handled by parent gap */
}

.auth-footer .m3-button--text {
    padding: 8px;
    margin-left: 4px;
}


/* -- Material 3: Text Field (Outlined) -- REFINED */
.m3-text-field {
    position: relative;
}

.m3-text-field__input {
    width: 100%;
    height: 56px;
    padding: 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-extra-small); /* 8px */
    background-color: transparent;
    color: var(--md-sys-color-on-surface);
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    transition: border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized-decelerate);
}

.m3-text-field__label {
    position: absolute;
    top: 18px;
    left: 16px;
    color: var(--md-sys-color-on-surface-variant);
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    line-height: var(--md-sys-typescale-body-large-line-height);
    background-color: var(--md-sys-color-surface-container-low);
    padding: 0 4px;
    pointer-events: none;
    transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized-decelerate);
}

.m3-text-field__input:focus {
    border-color: var(--md-sys-color-primary); /* Sync border */
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -2px; /* Prevents layout shift */
}

.m3-text-field__input:focus + .m3-text-field__label,
.m3-text-field__input:not(:placeholder-shown) + .m3-text-field__label {
    top: -8px;
    font-size: var(--md-sys-typescale-body-small-size, 12px);
    line-height: var(--md-sys-typescale-body-small-line-height, 16px);
}

.m3-text-field__input:focus + .m3-text-field__label {
    color: var(--md-sys-color-primary);
}


/* -- Material 3: Button -- REFINED */
.m3-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 48px; /* Taller for a more premium feel */
    border: none;
    border-radius: var(--md-sys-shape-full);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    font-weight: 500;
}

.m3-button--filled {
    width: 100%;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-level0);
    padding: 0 24px;
    transition: box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized-decelerate),
                transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized-decelerate),
                background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized-decelerate);
}

.m3-button--filled:hover {
    box-shadow: var(--md-sys-elevation-level1);
    transform: translateY(-2px);
}

.m3-button--filled:active {
    transform: translateY(0);
    box-shadow: var(--md-sys-elevation-level0);
}

.m3-button--text {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 12px;
    transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized-decelerate);
}

.m3-button--text:hover {
    background-color: rgba(var(--md-sys-color-primary-rgb), 0.08);
}


/* -- Material 3: Flash Message -- REFINED */
.m3-flash-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--md-sys-shape-small); /* 12px */
}

.m3-flash-message .material-symbols-outlined {
    font-size: 20px;
}

.m3-flash-message--success {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.m3-flash-message--danger {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.m3-flash-message--warning {
    background-color: var(--md-sys-color-tertiary-container);
    color: var(--md-sys-color-on-tertiary-container);
}

.m3-flash-message--info {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}