/* Authentication Pages (Login, etc.) */

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

body {
    background: var(--color-brand-navy) url('/images/brand-background.webp') center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Starts from the home page's tint and fades it away as the page loads.
   Fading opacity on its own layer keeps the animation smooth; z-index -1
   keeps it above the photo but under the page content. */
.fading-tint::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--color-brand-navy) var(--brand-tint-strength), transparent);
    pointer-events: none;
    animation: fadeOut 1s ease-out forwards;
    will-change: opacity;
}

.container {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-border-secondary);
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.4s ease-out;
}

h1 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    text-align: center;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.checkbox-group {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.checkbox-group label {
    color: #333;
    font-weight: normal;
}

/* Remembered accounts */
.remembered-accounts {
    margin-bottom: 1.5rem;
}

.remembered-accounts__label {
    color: #666;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.remembered-accounts__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background: #fafafa;
    cursor: pointer;
    font-size: 0.9375rem;
    color: #333;
    text-align: left;
    transition: border-color 0.15s, background-color 0.15s;
}

.account-card:hover {
    border-color: #667eea;
}

.account-card__email {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-card__sso-badge {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0078d4;
    background: #e8f0fe;
    padding: 0.125rem 0.4rem;
    border-radius: 0.25rem;
}

.account-card__remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    transition: background-color 0.15s;
}

.account-card__remove::before {
    content: '';
    display: block;
    width: 0.625rem;
    height: 0.625rem;
    background-image: url('/images/icons_sunrise/Exit.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.account-card__remove:hover::before {
    background-image: url('/images/icons_blaze/Exit.svg');
}

/* Error messages */
.error {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #fcc;
    animation: fadeIn 0.3s ease-out;
}

.back-link {
    display: block;
    width: fit-content;
    margin: 1.5rem auto 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.back-link:hover {
    color: var(--color-brand-navy);
    text-decoration: underline;
}

input[type="email"],
input[type="password"] {
    transition: border-color 0.2s;
}

input[type="email"]:focus-visible,
input[type="password"]:focus-visible {
    outline: none;
    border-color: var(--color-brand-navy);
    box-shadow: 0 0 0 3px rgba(0, 48, 87, 0.25);
}

/* Submit button loading state */
.theme-button {
    position: relative;
}

.btn-spinner {
    display: none;
}

.theme-button.is-loading .btn-text {
    visibility: hidden;
}

.theme-button.is-loading .btn-spinner {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: 1.25rem;
    margin: -0.625rem 0 0 -0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* SSO option transition */
/* Forgot password notice */
.forgot-password {
    text-align: center;
    color: #999;
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}
