@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("./ibm-plex-sans-400.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("./ibm-plex-sans-500.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("./ibm-plex-sans-600.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-style: italic;
    font-weight: 900;
    font-display: swap;
    src: url("./fraunces-900-italic.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --brand-night: #0f1125;
    --brand-white: #ffffff;
    --brand-acid: #b6ff51;
    --brand-acid-hover: #a6ed4b;
    --brand-violet: #7361ff;
    --background: #f5f6f6;
    --foreground: var(--brand-night);
    --card: var(--brand-white);
    --muted: #edf0ef;
    --surface-hover: #e0e8e5;
    --muted-foreground: rgb(15 17 37 / 0.60);
    --border: rgb(15 17 37 / 0.12);
    --input-border: rgb(15 17 37 / 0.50);
    --input-background: var(--card);
    --destructive: #b42318;
    --success: #3f8f63;
    --card-shadow: 0 1px 2px rgb(15 17 37 / 0.04), 0 8px 24px rgb(15 17 37 / 0.05);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    background: var(--background);
}

body {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: max(2rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(2rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    place-items: center;
    background: var(--background);
    color: var(--foreground);
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

.auth-shell {
    display: grid;
    width: min(100%, 24rem);
    gap: 1.5rem;
}

.brand-header {
    display: grid;
    justify-items: center;
    gap: 1rem;
    text-align: center;
}

.brand-header picture {
    display: block;
    line-height: 0;
}

.brand-logo {
    display: block;
    width: 8rem;
    height: auto;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    color: var(--foreground);
    font-family: "Fraunces", ui-serif, Georgia, serif;
    font-size: 2rem;
    font-style: italic;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    overflow-wrap: anywhere;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.auth-card {
    display: grid;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: var(--card);
    box-shadow: var(--card-shadow);
}

.intro {
    display: grid;
    gap: 0.5rem;
}

.intro p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.5rem;
}

.button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}

.primary {
    background: var(--brand-acid);
    color: var(--brand-night);
}

.primary:hover {
    background: var(--brand-acid-hover);
}

.secondary {
    border-color: var(--input-border);
    background: var(--muted);
    color: var(--foreground);
}

.secondary:hover {
    background: var(--surface-hover);
}

.button:active {
    transform: scale(0.97);
}

.button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--brand-violet);
    outline-offset: 2px;
}

.button-arrow {
    font-size: 1.125rem;
    line-height: 0;
}

.approval-status {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-weight: 500;
}

.approval-status::before {
    width: 0.5rem;
    height: 0.5rem;
    flex: none;
    border-radius: 999px;
    background: var(--brand-violet);
    box-shadow: 0 0 0 0 rgb(115 97 255 / 0.35);
    content: "";
}

.approval-status[data-state="waiting"]::before {
    animation: status-pulse 1.6s ease-out infinite;
}

.approval-status[data-state="approved"]::before {
    background: var(--success);
}

.approval-status[data-state="error"]::before {
    background: var(--destructive);
}

.helper-text {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.helper-text[data-state="error"] {
    color: var(--destructive);
}

.helper-text[data-state="success"] {
    color: var(--success);
}

.approval-controls {
    display: flex;
    gap: 0.75rem;
}

.approval-controls .button {
    flex: 1;
}

.social-actions {
    display: grid;
    gap: 0.75rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    white-space: nowrap;
}

.divider::before,
.divider::after {
    flex: 1;
    border-top: 1px solid var(--border);
    content: "";
}

.login-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.35rem;
}

label {
    overflow: hidden;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

input {
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--input-border);
    border-radius: 0.625rem;
    outline: none;
    background: var(--input-background);
    color: var(--foreground);
    font-size: 1rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus-visible {
    border-color: var(--brand-violet);
    box-shadow: 0 0 0 2px rgb(115 97 255 / 0.16);
}

input[aria-invalid="true"] {
    border-color: var(--destructive);
}

.error {
    color: var(--destructive);
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.account-summary,
.permissions {
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: var(--muted);
    font-size: 0.875rem;
}

.account-summary {
    display: grid;
    gap: 0.125rem;
    color: var(--muted-foreground);
    overflow-wrap: anywhere;
}

.account-summary strong,
.account-summary dd,
.permissions-title {
    color: var(--foreground);
    font-weight: 600;
}

.account-summary dt,
.account-summary dd {
    margin: 0;
}

.account-summary dd + dt {
    margin-top: 0.5rem;
}

.permissions-title {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.permissions ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.permissions li {
    font-size: 0.875rem;
    line-height: 1.5rem;
}

.permissions li::marker {
    color: var(--brand-violet);
}

.permissions li + li {
    margin-top: 0.375rem;
}

.consent-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.consent-actions form {
    min-width: 0;
}

.consent-actions-single {
    grid-template-columns: 1fr;
}

@keyframes status-pulse {
    70% {
        box-shadow: 0 0 0 0.35rem rgb(115 97 255 / 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgb(115 97 255 / 0);
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --background: var(--brand-night);
        --foreground: var(--brand-white);
        --card: #191b30;
        --muted: #25283d;
        --surface-hover: #303349;
        --muted-foreground: rgb(255 255 255 / 0.68);
        --border: rgb(255 255 255 / 0.16);
        --input-border: rgb(255 255 255 / 0.45);
        --input-background: #24263a;
        --destructive: #f87171;
        --success: #4ade80;
        --card-shadow: 0 1px 2px rgb(0 0 0 / 0.24), 0 10px 28px rgb(0 0 0 / 0.18);
    }
}

@media (prefers-reduced-motion: reduce) {
    .button,
    input {
        transition: none;
    }

    .button:active {
        transform: none;
    }

    .approval-status[data-state="waiting"]::before {
        animation: none;
    }
}
