/* ========================================================
   Variables
   ======================================================== */
:root {
    /* The reference login's vivid brand blue, nudged from #1a6dff to clear the 4.5:1 AA floor for
       normal text: #1a6dff measures 4.49:1 against white, this measures 4.70:1, and the two are
       indistinguishable. That lets --primary carry blue-on-white text and white-on-blue fills
       directly, with --primary-dark as their hover step. Anything sitting on a tinted or coloured
       ground still needs checking on its own background. */
    --primary: #1a68ff;
    --primary-dark: #0f56d1;
    --primary-rgb: 26, 109, 255;
    --primary-50: rgba(26, 109, 255, 0.08);
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f9fafb;
    --white: #ffffff;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    /* The dark navy of the login heading. */
    --heading: #123a5c;
    /* Filled inputs: a soft blue fill whose border only appears on focus. */
    --field-bg: #eef3fc;
    /* The very light fill of the contact and notice cards. */
    --card-bg: #f7f9fd;
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

/* ========================================================
   Base
   ======================================================== */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================================
   Site Layout (_Layout.cshtml)
   ======================================================== */
.main-content {
    min-height: calc(100vh - 60px);
}

.site-footer {
    height: 60px;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-footer p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.site-footer a {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ========================================================
   Index Page
   ======================================================== */
.index-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3.5rem 1.5rem 4rem;
    min-height: calc(100vh - 60px);
}

/* The shipped logo's wordmark is dark ink (it has to be legible on the login brand panel, which
   is now a light gradient), so this plate has to stay light too. */
.index-header {
    background: linear-gradient(135deg, #eaf2ff 0%, #a9cdfb 100%);
    padding: 1rem 2.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
}

.index-logo {
    height: 40px;
    width: auto;
    display: block;
}

.index-hero {
    text-align: center;
    max-width: 520px;
    margin-bottom: 3rem;
}

.index-subtitle {
    font-size: 1.0625rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

.index-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 760px;
    width: 100%;
    margin-bottom: 3rem;
}

@media (max-width: 640px) {
    .index-features {
        grid-template-columns: 1fr;
        max-width: 360px;
    }
}

.feature-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-50);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.875rem;
    font-size: 1.25rem;
    color: var(--primary);
}

.feature-item h6 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.375rem;
}

.feature-item p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.index-auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
}

.auth-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: var(--radius);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.auth-badge i {
    color: #16a34a;
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 0.6875rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
    text-decoration: none;
}

.btn-primary-action:hover {
    background: var(--primary-dark);
    color: var(--white);
    text-decoration: none;
}

.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6875rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background-color 0.15s;
    text-decoration: none;
}

.btn-secondary-action:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

/* ========================================================
   Form Components (Login.cshtml)
   ======================================================== */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1.125rem;
}

.field > label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.field-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    /* Transparent rather than absent so focus can reveal the border without shifting the height. */
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--text);
    background-color: var(--field-bg);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

/* A 0.08 ring would disappear into the field fill, so the focus ring uses the same hue at an
   alpha that still reads against --field-bg. */
.field-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.22);
}

/* Darker than the old #9ca3af, which only cleared 2.3:1 against the new field fill. */
.field-input::placeholder {
    color: #5d6673;
}

/* ASP.NET validation classes */
.field-validation-error {
    font-size: 0.8125rem;
    color: var(--danger);
    display: block;
    margin-top: 0.25rem;
}

.field-validation-valid {
    display: none;
}

.validation-summary-errors {
    padding: 0.75rem 1rem;
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    border-left: 3px solid var(--danger);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--danger);
}

.validation-summary-errors ul {
    margin: 0.375rem 0 0;
    padding-left: 1.25rem;
}

.validation-summary-valid {
    display: none;
}

/* Single child since the dead password-recovery link was removed, so the alignment is stated
   explicitly instead of relying on space-between collapsing to the main-start edge. The language
   picker is not in this row — it has its own .login-language form above the header. */
.field-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
}

.field-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
    user-select: none;
}

.field-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.link-subtle {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.link-subtle:hover {
    text-decoration: underline;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: inherit;
    margin-bottom: 0.75rem;
}

.btn-submit:hover {
    background-color: var(--primary-dark);
}

.btn-submit:focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
}

.btn-external {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background-color 0.15s;
    font-family: inherit;
}

.btn-external:hover {
    background: var(--bg);
    border-color: #9ca3af;
}

/* ========================================================
   Login Split Layout (_LoginLayout.cshtml)
   ======================================================== */
body.login-page {
    background-color: var(--white);
    margin: 0;
}

.login-split-container {
    display: flex;
    min-height: 100vh;
}

/* Second in the DOM, so it lands on the right of the row and below the form when stacked. */
.login-brand-panel {
    flex: 0 0 55%;
    background: linear-gradient(135deg, #eaf2ff 0%, #a9cdfb 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.login-brand-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.12;
}

.login-brand-deco--top {
    width: 460px;
    height: 460px;
    background: var(--primary);
    top: -160px;
    right: -100px;
}

.login-brand-deco--bottom {
    width: 320px;
    height: 320px;
    background: var(--primary);
    bottom: -110px;
    left: -70px;
}

.login-brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.login-logo-link {
    display: inline-block;
}

/* A tenant logo is a remote image of arbitrary dimensions, so height/max-height keep a tall one
   from stretching the brand panel and object-fit stops the clamp from distorting it. */
.login-logo {
    width: 400px;
    max-width: 82%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}

/* White has nothing to sit on now that the panel is a light gradient. */
.login-brand-footer {
    color: var(--heading);
    font-size: 0.78rem;
    position: relative;
    z-index: 1;
}

/* First in the DOM — the form leads for keyboard and screen-reader users and, since the panels
   were mirrored, visually too. No CSS `order` is involved. */
.login-form-panel {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    padding: 2.5rem 2rem;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

.login-language {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}

.login-language i {
    font-size: 0.9rem;
}

.login-language-select {
    appearance: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
}

.login-language-select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.login-language-apply {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
}

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

/* Branding.Header, above the heading rather than replacing it. Semibold and small in the brand
   blue: no uppercase, no wide tracking — our type, the reference's colour. */
.login-overline {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.375rem;
    overflow-wrap: anywhere;
}

.login-form-header h4 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 0.375rem;
    line-height: 1.25;
}

.login-form-header p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
}

/* Sits between the subtitle and the credentials. <h5> keeps the outline in order under the <h4>. */
.login-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem;
}

.login-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
}

.login-separator::before,
.login-separator::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.login-separator span {
    padding: 0 0.75rem;
    font-size: 0.8125rem;
}

/* The card treatment the contact block and the notice share. It lives on those elements
   themselves rather than on a wrapper div, so the "nothing renders when there is no data"
   guarantee holds for free: no data, no element, no border and no padding. */
.login-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card-bg);
    padding: 0.875rem 1rem;
}

/* Tenant contact details. Only rendered when at least one value exists. <address> is italic by
   default, which this copy is not. */
.login-contact {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 1.5rem 0 0;
    font-style: normal;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Long values (a support contact, a comment) wrap instead of overflowing the 380px panel. */
.login-contact-line {
    overflow-wrap: anywhere;
}

.login-contact-mail {
    /* --primary-dark, not --primary: this link sits on --card-bg, not on white, where
       --primary measures 4.46:1 — just under the AA floor for normal text. */
    color: var(--primary-dark);
    font-weight: 500;
}

.login-contact-mail:hover {
    text-decoration: underline;
}

.login-contact-mail:focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* MensajeEnPaginaLogin — a free-text notice. Same card as the contact block, kept deliberately
   distinct from it by the accent on its leading edge. */
.login-notice {
    margin: 1rem 0 0;
    border-left: 3px solid var(--primary);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text);
    overflow-wrap: anywhere;
}

.login-secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 1.75rem;
}

.login-secure-badge i {
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .login-brand-panel {
        flex: 0 0 48%;
        padding: 2.5rem 2rem;
    }

    .login-logo {
        width: 260px;
        max-height: 150px;
    }
}

@media (max-width: 680px) {
    /* Column direction follows the DOM, so the form stays first and the brand panel stacks
       underneath it — no `order` needed here either. */
    .login-split-container {
        flex-direction: column;
    }

    .login-brand-panel {
        flex: 0 0 auto;
        padding: 2rem 1.5rem;
        min-height: 160px;
    }

    .login-logo {
        width: 160px;
        max-height: 96px;
    }

    .login-brand-footer {
        display: none;
    }

    .login-form-panel {
        flex: 1;
        padding: 2rem 1.5rem;
        align-items: flex-start;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    /* Tighter on a phone, where these cards sit under an already tall form. */
    .login-contact {
        margin-top: 1.25rem;
    }

    .login-notice {
        margin-top: 0.875rem;
    }
}

/* ========================================================
   Auth screen shell — shared by /Connect/Authorize, /Connect/Logout,
   /Account/AccessDenied and /Error. The consent-* rules below it are the
   only ones specific to the OIDC consent screen.
   ======================================================== */

/* Centres the shell on the plain _Layout, which only stacks its children. On _LoginLayout the
   .login-form-panel already does the centring, so this wrapper is not used there. */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    /* The same height .main-content reserves: a flex child does not inherit its parent's
       min-height, so it has to be repeated for the vertical centring to have room to work. */
    min-height: calc(100vh - 60px);
    padding: 2rem 1.5rem;
    box-sizing: border-box;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
    position: relative;
    padding: 20px 30px;
}

.auth-header {
    margin-bottom: 1.5rem;
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-overline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: 0.02em;
}

.auth-overline .auth-overline-shield {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.auth-overline-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border);
    margin: 0 0.1rem;
}

.auth-overline-step {
    color: var(--text-muted);
}

.auth-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

.auth-subtitle strong {
    color: var(--text);
    font-weight: 600;
}

/* --- Requesting application --- */
.consent-app {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.08s;
    box-shadow: var(--shadow-sm);
}

.consent-app-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    background: var(--primary);
    box-shadow: 0 6px 14px -6px rgba(var(--primary-rgb), 0.5);
}

.consent-app-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.consent-app-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.consent-app-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.consent-app-verified i {
    color: #16a34a;
    font-size: 0.85rem;
}

/* --- Requested permissions --- */
.consent-permissions {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1rem;
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.16s;
}

.consent-permissions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.consent-permissions-head h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.consent-permissions-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--primary-50);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-weight: 600;
}

.consent-permissions-count:empty {
    display: none;
}

.consent-permission-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.consent-permission-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.consent-permission-progress::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

.consent-permission-empty {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0.125rem 0;
    line-height: 1.5;
}

.consent-permission-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.675rem 0.75rem;
    border-radius: var(--radius);
    transition: background-color 0.15s;
}

.consent-permission-row:hover {
    background: var(--bg);
}

.consent-permission-row--sensitive {
    background: rgba(180, 83, 9, 0.07);
    border-left: 3px solid #f59e0b;
}

.consent-permission-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    color: var(--primary);
    background: var(--primary-50);
}

.consent-permission-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.consent-permission-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.consent-permission-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.auth-code {
    font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: #f1f3f5;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.08rem 0.45rem;
    white-space: nowrap;
    align-self: center;
}

.consent-permission-row + .consent-permission-row,
.consent-permission-row + .consent-permission-empty {
    margin-top: 0.375rem;
}

.consent-sensitive-note {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.78125rem;
    color: #92400e;
    margin-top: 0.75rem;
    line-height: 1.5;
}

.consent-sensitive-note i {
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* --- Trust signal --- */
.auth-trust {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1.125rem;
    padding: 0.75rem 1rem;
    background: var(--primary-50);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: var(--radius);
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.24s;
}

.auth-trust-icon {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.auth-trust p {
    font-size: 0.8125rem;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

/* --- Actions --- */
.auth-form {
    margin-top: 1.5rem;
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

/* Also worn by an <a> (the "back to home" exit), so the base anchor underline is cleared here
   rather than at every call site. */
.auth-action,
.auth-action:hover {
    text-decoration: none;
}

.auth-action {
    width: 100%;
    padding: 0.8125rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.15s,
        border-color 0.15s,
        box-shadow 0.15s,
        transform 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* The same fill and hover step as the login's .btn-submit, flat rather than a gradient — the login
   has no gradient anywhere, which is what made this button read as a different product. */
.auth-action--primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.625rem;
}

.auth-action--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(var(--primary-rgb), 0.35);
}

.auth-action--primary:focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
}

.auth-action--ghost {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.auth-action--ghost:hover {
    background: var(--bg);
    border-color: #9ca3af;
    color: var(--danger);
    transform: translateY(-1px);
}

.auth-action--ghost:focus-visible {
    outline: 2px solid rgba(107, 114, 128, 0.5);
    outline-offset: 2px;
}

.auth-legal {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.36s;
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    .auth-header,
    .consent-app,
    .consent-permissions,
    .auth-trust,
    .auth-form,
    .auth-legal {
        animation: none;
    }

    .consent-permission-progress::before {
        animation: none;
    }
}
