/*
 * FOYS theme — clean Bootstrap 5 look for the server-rendered Razor pages
 * (login, password reset, 2FA, organisation selection).
 *
 * Mirrors the house style of foys-spa-wrapper (branch feature/next): navy
 * primary, blue accent, soft rounded surfaces. Theming is done purely with
 * Bootstrap 5 CSS variables so no SCSS build step is needed in the backend.
 */

:root {
    --foys-navy: #101630;
    --foys-navy-700: #1b2347;
    --foys-accent: #2563eb;
    --foys-accent-600: #1d4ed8;

    --bs-link-color: var(--foys-accent);
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: var(--foys-accent-600);
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--bs-body-font-family);
    /* Default background when no tenant login image is set (see _LayoutPage). */
    background: linear-gradient(160deg, #062143 0%, #101630 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Vertically + horizontally centre the auth card. Keeping the inner .row at
   full width preserves the existing column/offset markup on each page. */
.layout-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    /* No horizontal padding: the card uses its own inner padding, so this gives
       the content the full viewport width on mobile. Override Bootstrap's
       .container-fluid gutter explicitly. */
    padding: 0;
}

.layout-page > .row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* The div that wraps the card fills the row and may shrink below its content
   width on small viewports; the card's own max-width controls the visible size,
   so it never overflows narrow screens. */
.layout-page > .row > * {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
}

/* Auth card */
.login-container {
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    border: none;
    border-radius: 1rem;
    padding: 1.5rem !important;
    background-color: #fff;
    box-shadow: 0 1.5rem 3rem rgba(8, 15, 40, 0.25);
}

/* Wider variant for content-heavy cards (e.g. authenticator setup + QR code). */
.login-container--wide {
    max-width: 560px;
}

.login-container label {
    font-weight: 600;
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.25rem !important;
        border-radius: 0.75rem;
    }
}

/* Form controls */
.login-container .form-control,
.login-container .form-select {
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
}

.login-container .form-control:focus,
.login-container .form-select:focus {
    border-color: var(--foys-accent);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
}

/* Compact 0.8rem typography for the auth forms (inputs, buttons, links, paragraphs) */
.login-container p,
.login-container a,
.login-container .btn,
.login-container .form-control,
.login-container .form-select {
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-primary {
    --bs-btn-bg: var(--foys-navy);
    --bs-btn-border-color: var(--foys-navy);
    --bs-btn-hover-bg: var(--foys-navy-700);
    --bs-btn-hover-border-color: var(--foys-navy-700);
    --bs-btn-active-bg: var(--foys-navy-700);
    --bs-btn-active-border-color: var(--foys-navy-700);
    --bs-btn-disabled-bg: var(--foys-navy);
    --bs-btn-disabled-border-color: var(--foys-navy);
}

/* The eye/toggle button sits flush against the input inside an input-group. */
.input-group .btn-outline-secondary {
    border-color: var(--bs-border-color);
}

/* Footer with the FOYS logo, anchored bottom-right on top of the background. */
.footer {
    position: fixed;
    bottom: 12px;
    right: 16px;
    color: #fff;
    text-align: right;
    opacity: 0.9;
}

.footer span {
    font-size: 0.8rem;
}

/* Organisation selection tiles */
.organisation-block a {
    display: inline-block;
    padding: 1rem;
    border-radius: 0.75rem;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.organisation-block a:hover {
    background-color: var(--bs-tertiary-bg);
    box-shadow: 0 0.25rem 0.75rem rgba(8, 15, 40, 0.12);
}
