/* OHMe OAuth login: same look as the OHMe Tech web app (colors, radius,
   card, two columns on desktop), with the orange of the OHMe app. */

:root {
    color-scheme: light;
    --radius: 0.375rem;

    --background: #f4f5f7;
    --foreground: #1c1e22;
    --sidebar: #fbfbfc;
    --card: #ffffff;

    /* OHMe orange. The brand color (#ef6c00) is in the logo; text and
       buttons use a darker shade so they stay readable (contrast ≥ 4.5:1). */
    --brand: #ef6c00;
    --primary: #c2410c;
    --primary-hover: #a8380a;
    --primary-foreground: #ffffff;
    --primary-soft: rgba(239, 108, 0, 0.12);
    --primary-border: rgba(239, 108, 0, 0.35);

    --secondary: #eceef2;
    --muted-foreground: #5e6570;
    --destructive: #dc2626;
    --destructive-soft: rgba(220, 38, 38, 0.08);
    --border: #e2e4e9;
    --input: #d8dbe1;
    --ring: rgba(194, 65, 12, 0.45);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --background: #0e0f13;
        --foreground: #e7e8ec;
        --sidebar: #121318;
        --card: #17181d;

        --primary: #fb923c;
        --primary-hover: #fdba74;
        --primary-foreground: #1f1006;
        --primary-soft: rgba(251, 146, 60, 0.14);
        --primary-border: rgba(251, 146, 60, 0.35);

        --secondary: #22232a;
        --muted-foreground: #9aa0ab;
        --destructive: #f87171;
        --destructive-soft: rgba(248, 113, 113, 0.1);
        --border: #2a2c33;
        --input: #34363f;
        --ring: rgba(251, 146, 60, 0.5);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--foreground);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--foreground);
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

h1,
h2,
p {
    margin: 0;
}

.muted {
    color: var(--muted-foreground);
}

/* Layout: one column on phones (card first), two columns from 1024px. */

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.intro {
    order: 2;
    position: relative;
    overflow: hidden;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    background: var(--sidebar);
}

@media (min-width: 1024px) {
    .layout {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    }

    .main {
        order: 2;
    }

    .intro {
        order: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 48px;
        border-top: 0;
        border-right: 1px solid var(--border);
    }
}

/* Presentation column. */

.intro-glow {
    position: absolute;
    left: -96px;
    top: -96px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: var(--primary-soft);
    filter: blur(64px);
    pointer-events: none;
}

.intro-body,
.intro-footer {
    position: relative;
}

.intro-body {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.brand-large {
    display: none;
    font-size: 1.125rem;
}

@media (min-width: 1024px) {
    .brand-large {
        display: flex;
    }
}

.intro-text {
    max-width: 32rem;
}

.intro-text h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
}

.intro-text p {
    margin-top: 12px;
    font-size: 0.9375rem;
    line-height: 1.625;
    color: var(--muted-foreground);
}

@media (min-width: 1024px) {
    .intro-text h2 {
        font-size: 1.875rem;
    }
}

.features {
    display: grid;
    gap: 16px;
    max-width: 42rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) {
    .features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.features li {
    display: flex;
    gap: 12px;
}

.feature-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary);
}

.feature-icon svg {
    width: 18px;
    height: 18px;
}

.feature-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}

.feature-text {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.625;
    color: var(--muted-foreground);
}

.intro-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 40px;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.intro-footer a:first-child {
    font-weight: 500;
    color: var(--primary);
}

/* Card. */

.card {
    width: 100%;
    max-width: 24rem;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.card-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--primary);
}

.card-header p {
    font-size: 0.875rem;
}

.logo-md {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-lg {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.request {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--secondary);
    font-size: 0.875rem;
}

.client-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Form. */

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.fields:disabled {
    opacity: 0.6;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    /* 16px: iOS does not zoom into the field. */
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

input:focus {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
    border-color: var(--primary);
}

.password {
    position: relative;
}

.password input {
    padding-right: 44px;
}

.icon-button {
    position: absolute;
    right: 4px;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
}

.icon-button:hover {
    color: var(--foreground);
}

.icon-button:focus-visible {
    outline: 2px solid var(--ring);
}

.icon-button svg {
    width: 16px;
    height: 16px;
}

.icon-button .eye-off,
.icon-button[aria-pressed="true"] .eye {
    display: none;
}

.icon-button[aria-pressed="true"] .eye-off {
    display: block;
}

.mfa {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    background: var(--primary-soft);
}

.mfa label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mfa label svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.mfa input {
    letter-spacing: 0.2em;
}

.hint {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.message {
    font-size: 0.875rem;
    color: var(--destructive);
}

.message.info {
    color: var(--muted-foreground);
}

/* Buttons. */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--foreground);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.button:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.button:disabled {
    opacity: 0.5;
    cursor: default;
}

.button-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.button-primary:not(:disabled):hover {
    background: var(--primary-hover);
}

.button-outline {
    border-color: var(--input);
}

.button-outline:not(:disabled):hover,
.button-ghost:not(:disabled):hover {
    background: var(--secondary);
}

.button .spinner {
    display: none;
}

.button.loading .spinner {
    display: inline-block;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-large {
    width: 32px;
    height: 32px;
    border-width: 3px;
    color: var(--primary);
}

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

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2s;
    }
}

/* Consent. */

.link-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 8px 0 24px;
}

.client-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: var(--radius);
    /* The client logos (static/images/*.svg) fill the box with their own
       background; gray is for the generic icon and for logos without one. */
    background: #4a4d55;
    /* Edge for white logos (Google) on the white card. */
    box-shadow: 0 0 0 1px var(--border);
}

.client-logo-sm {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.client-logo-sm svg {
    width: 16px;
    height: 16px;
}

.client-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.client-logo svg {
    width: 22px;
    height: 22px;
    color: #e7e8ec;
}

.link-icon {
    width: 20px;
    height: 20px;
    color: var(--muted-foreground);
}

.consent-text {
    text-align: center;
    font-size: 1rem;
}

.consent-info {
    margin-top: 8px;
    text-align: center;
    font-size: 0.875rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

/* Errors and redirect. */

.notice {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.notice svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.notice-error {
    border: 1px solid var(--destructive);
    background: var(--destructive-soft);
}

.notice-error svg {
    color: var(--destructive);
}

.notice-title {
    font-weight: 600;
}

.view-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    text-align: center;
    font-size: 0.875rem;
}
