/* Styling for the standalone authentication pages (Login, Two-factor).
   These Razor Pages render with Layout = null, so they cannot use the
   MudBlazor shell; this stylesheet mirrors the AdministrationTool palette
   (teal #8ECECB / purple #A96BC9) to keep the sign-in flow on-brand. */

:root {
    --auth-teal: #56AFB8;
    --auth-teal-dark: #007774;
    --auth-navy: #364557;
    --auth-purple: #A96BC9;
    --auth-purple-dark: #963BC5;
    --auth-canvas: #FAFAFA;
    --auth-surface: #FFFFFF;
    --auth-text: #364557;
    --auth-text-secondary: #465567;
    --auth-border: #E0E0E0;
    --auth-error: #AA4944;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: 'Open Sans', 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--auth-text);
    background: linear-gradient(135deg, #e9f3f4 0%, var(--auth-canvas) 55%, #eef0f3 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--auth-surface);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(45, 91, 87, 0.12);
    overflow: hidden;
}

/* Teal-to-navy accent strip across the top of the card (PM2 brand). */
.auth-card::before {
    content: "";
    display: block;
    height: 6px;
    background: linear-gradient(90deg, var(--auth-teal) 0%, var(--auth-navy) 100%);
}

.auth-inner {
    padding: 2.5rem 2.25rem 2.25rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--auth-teal-dark);
    margin-bottom: 1.75rem;
}

.auth-brand .auth-logo-img {
    height: 34px;
    width: auto;
}

.auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-subtitle {
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
    color: var(--auth-text-secondary);
}

.auth-field {
    margin-bottom: 1.15rem;
}

.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.auth-field input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:hover {
    border-color: var(--auth-teal);
}

.auth-field input:focus {
    outline: none;
    border-color: var(--auth-purple);
    box-shadow: 0 0 0 3px rgba(169, 107, 201, 0.18);
}

.auth-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: var(--auth-purple);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-btn:hover {
    background: var(--auth-purple-dark);
    box-shadow: 0 4px 14px rgba(169, 107, 201, 0.35);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 1.5rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.875rem;
    color: #fff;
    background: var(--auth-error);
    border-radius: 8px;
}

.auth-hint {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

/* --- Progress feedback (spinner shown on submit) ------------------------- */

.auth-btn.is-loading {
    opacity: 0.85;
    cursor: progress;
}

form.is-submitting {
    pointer-events: none;
}

.auth-spinner {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.5em;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* --- Consent screen ----------------------------------------------------- */

.auth-scope-group {
    margin: 1.1rem 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--auth-teal-dark);
}

.auth-scope {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.1rem;
    cursor: pointer;
    border-radius: 8px;
}

.auth-scope:hover {
    background: #f6f9f9;
}

.auth-scope input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--auth-purple);
    flex: 0 0 auto;
}

.auth-scope-label {
    font-size: 0.92rem;
    color: var(--auth-text);
}

.auth-scope-name {
    display: block;
    font-size: 0.74rem;
    color: var(--auth-text-secondary);
    font-family: 'Cascadia Code', 'Consolas', monospace;
}

.auth-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

.auth-actions .auth-btn {
    margin-top: 0;
}

.auth-btn-secondary {
    background: #fff;
    color: var(--auth-text-secondary);
    border: 1px solid var(--auth-border);
}

.auth-btn-secondary:hover {
    background: #f5f5f5;
    color: var(--auth-text);
    box-shadow: none;
}
