/*
 * Base styles for the hosted /auth/* screens (adr/003), in the BerriesCloud brand of account-web
 * (foundation doc/ui-design/plan/design-system.md, "Paper 2"): berry action colour, Figtree.
 * A deployment can still override the --brand-* custom properties to re-skin every screen.
 */
/* Figtree, self-hosted (SIL OFL 1.1, fonts/LICENSE.txt) so the sign-in pages make no third-party
   request. Variable weight 400-800; latin-ext carries the Hungarian and other Central European letters. */
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-display: swap;
    font-weight: 400 800;
    src: url("fonts/figtree-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
        U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-display: swap;
    font-weight: 400 800;
    src: url("fonts/figtree-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --brand-color: #c63164;
    --brand-color-hover: #a8274f;
    --brand-contrast: #ffffff;

    --surface: #ffffff;
    --page-bg: #f6f6f8;
    --text: #0b0b10;
    --text-muted: #32343f;
    --text-subtle: #4e505c;
    --border: #d8dae2;
    /* Input borders: 3:1 or more against the surface (WCAG 1.4.11). */
    --border-strong: #868896;
    --focus: #6c66d4;
    --error: #a61f15;
    --error-bg: #fde5e3;
    --success: #176a31;
    --radius: 12px;
    --font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    color: var(--text);
    background: var(--page-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Provider mark in the top left corner (ui-design 2026-11-04 onboarding). */
.auth-top {
    display: flex;
    align-items: center;
    padding: 18px 28px;
}

.auth-top__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.auth-top__brand img {
    width: 28px;
    height: 28px;
}

.auth-top__brand .auth-top__logo {
    width: auto;
    max-height: 28px;
}

.auth-top__muted {
    color: var(--text-subtle);
    font-weight: 500;
}

.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem 3rem;
}

@media (max-width: 480px) {
    .auth-top {
        padding: 16px;
    }

    .auth-shell {
        padding: 0 16px 2rem;
    }
}

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

/* The card header: the provider mark now sits in the top left corner (.auth-top), so the header's own
   provider name or logo is not shown. It stays in the markup as the provider name login-branding.js reads,
   and as the slot the login screen fills with the application icon. */
.auth-brand {
    text-align: center;
}

.auth-brand__logo,
.auth-brand__name {
    display: none;
}

/* The language select of the login (adr/050 point 15): a row of fixed height at the top of the card, so
   switching language or loading the branding never moves the content below it. */
.auth-lang {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    height: 2rem;
    margin: -0.5rem 0 0.75rem;
}

.auth-lang__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.auth-lang__select {
    height: 2rem;
    max-width: 10rem;
    padding: 0 0.5rem;
    font: inherit;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 0.5rem;
}

.auth-lang__select:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* The login screen reserves the height of the application icon, so swapping the provider header for the
   icon does not move the form (adr/038); an application without an icon collapses it. */
.auth-brand--reserved {
    margin-bottom: 1.5rem;
    min-height: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-brand--empty {
    min-height: 0;
    margin-bottom: 0;
}

.auth-brand__icon {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
}

.auth-brand__description {
    margin: 0.5rem 0 0;
    text-align: left;
    font-size: 0.9375rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.auth-brand__return {
    margin: 0.5rem 0 1rem;
    text-align: left;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.auth-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.auth-title--lg {
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Login: the provider mark (the vertical BerriesCloud logo) sits inside the card, above the heading,
   instead of the top left corner. The mark is drawn with ::before so the header's markup (read by
   login-branding.js) stays untouched; an application icon replacing the header content hides it. */
.auth-body--brand-in-card .auth-top {
    display: none;
}

.auth-body--brand-in-card .auth-brand::before {
    content: "";
    display: block;
    /* The logo's own proportions, 688 x 423. */
    width: 13rem;
    height: 8rem;
    margin: 0 auto 0.5rem;
    background: url("berries-cloud-vertical-color.svg") center / contain no-repeat;
}

.auth-body--brand-in-card .auth-brand:has(.auth-brand__icon)::before,
.auth-body--brand-in-card .auth-brand--empty::before {
    display: none;
}

.auth-body--brand-in-card .auth-brand--reserved {
    min-height: 0;
}

.auth-subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
}

.auth-field {
    margin-bottom: 1rem;
}

/* A value the person cannot change on this step (the new-user email): label and text, no input. */
.auth-readonly {
    margin: 0 0 1rem;
}

.auth-readonly dt {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.auth-readonly dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* The new-user step's title is a sentence; the regular title size keeps it on one line. */
#login-title[data-step="details"],
.auth-title--details {
    font-size: 1.375rem;
    line-height: 1.3;
    letter-spacing: 0;
}

.auth-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.auth-field input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
}

.auth-field input:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 1px;
    border-color: var(--brand-color);
}

.auth-field input[aria-invalid="true"] {
    border-color: var(--error);
}

.auth-field__error {
    display: block;
    margin-top: 0.375rem;
    color: var(--error);
    font-size: 0.875rem;
}

.auth-field__error:empty {
    display: none;
}

.auth-button {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--brand-contrast);
    background: var(--brand-color);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.auth-button:hover {
    background: var(--brand-color-hover);
}

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

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* A link drawn as the primary button (the staff company sign-in). */
.auth-button--link {
    display: block;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
}

/* Secondary action: a tinted brand button for the less prominent choice (Create an account). */
.auth-button--secondary {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--brand-color);
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}

.auth-button--secondary:hover {
    color: var(--brand-color-hover);
    background: #e0e7ff;
}

.auth-divider--subtle {
    margin: 1.5rem 0 1rem;
}

.auth-divider--subtle::before {
    border-top-color: #e4e4e7;
}

.auth-divider--subtle::after {
    display: none;
}

.auth-signup-note {
    margin: 0 0 0.75rem;
}

.auth-linkbutton {
    display: inline;
    padding: 0;
    font: inherit;
    color: var(--brand-color);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.auth-alert--error {
    color: var(--error);
    background: var(--error-bg);
}

.auth-note {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin: 1rem 0 0;
}

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

.auth-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand-color);
    flex: none;
}

.auth-checkbox label {
    font-size: 0.9375rem;
    color: var(--text);
    cursor: pointer;
}

.auth-checkbox input:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 1px;
}

/* Social sign-in (adr/053): one "Continue with ..." link per enabled provider, drawn by login.js. */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 1.5rem 0;
}

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

.auth-divider span {
    padding: 0 0.75rem;
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-social__button {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: block;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
}

.auth-social__button:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 1px;
}

.auth-social__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-social__note {
    text-align: center;
}

.auth-center {
    text-align: center;
}

.auth-spinner {
    width: 2.5rem;
    height: 2.5rem;
    margin: 1rem auto;
    border: 3px solid var(--border);
    border-top-color: var(--brand-color);
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

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

.auth-strength {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.auth-strength__bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
}

.auth-strength--weak .auth-strength__bar:nth-child(1) {
    background: var(--error);
}

.auth-strength--fair .auth-strength__bar:nth-child(1),
.auth-strength--fair .auth-strength__bar:nth-child(2) {
    background: #b45309;
}

.auth-strength--strong .auth-strength__bar {
    background: var(--success);
}

.auth-strength__label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Customer sign-in (adr/050): six single-digit code inputs, the resend / change email line, the terms line. */
.auth-code {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.auth-code__digit {
    width: 2.75rem;
    padding: 0.625rem 0;
    font-size: 1.5rem;
    font-family: inherit;
    text-align: center;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
}

.auth-code__digit:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 1px;
    border-color: var(--brand-color);
}

.auth-code__digit[aria-invalid="true"] {
    border-color: var(--error);
}

.auth-code__keep {
    justify-content: center;
    margin-top: 1rem;
}

.auth-code__links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.auth-linkbutton:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    text-decoration: none;
}

.auth-terms a {
    color: var(--brand-color);
}

.auth-hidden {
    display: none;
}

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

/* The provider line of the new-user step (view 3, provider variant): "Continue with Google" above the
   read-only email, with the provider's picture as a small round read-only preview. */
.auth-provider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-provider__picture {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.auth-provider__text {
    font-size: 0.875rem;
    color: var(--auth-muted);
}
