/* ObelioCore login — standalone split-view (60/40).
 *
 * Standalone on purpose: the login page builds its own <head> and never loads
 * the theme bundle, so this file sits OUTSIDE the @layer architecture and can
 * be read on its own. Moved from ObelioTheme/Assets/CSS/login-obelio.css on
 * 2026-08-06; the 2FA modal, QR and backup-code rules were dropped with it —
 * second factor is FacturaScripts' own screen now.
 */

body.ob-login {
    margin: 0;
    padding: 0;
    font-family: var(--ob-font-body, Inter, system-ui, sans-serif);
    background: #f8fafc;
}

.ob-login__container {
    display: flex;
    min-height: 100vh;
}

/* Left: splash image + branding (60%) */
.ob-login__splash {
    flex: 0 0 60%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #026aa7 0%, #61b7ad 100%);
    color: white;
    overflow: hidden;
}

.ob-login__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
}

.ob-login__background--default {
    background: linear-gradient(135deg, rgba(2, 106, 167, 0.5) 0%, rgba(97, 183, 173, 0.5) 100%);
}

.ob-login__overlay {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    gap: 2rem;
}

.ob-login__logo {
    max-height: 80px;
    max-width: 250px;
}

.ob-login__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ob-login__slogan {
    font-size: 1.125rem;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
}

.ob-login__rgpd {
    position: relative;
    z-index: 10;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    text-align: left;
}

.ob-login__rgpd details {
    cursor: pointer;
}

.ob-login__rgpd summary {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.ob-login__rgpd summary:hover {
    opacity: 1;
}

.ob-login__rgpd p {
    font-size: 0.75rem;
    margin-top: 0.75rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Right: login form (40%) */
.ob-login__form-wrapper {
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.05);
}

.ob-login__form-container {
    width: 100%;
    max-width: 380px;
}

/* Clinic logo, above the company short name. It spans the width of the right
   block and is centered; object-fit keeps it from stretching when the clinic
   uploads a non-landscape file. */
.ob-login__brand-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 96px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 1.5rem;
}

.ob-login__form-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 2rem 0;
    color: #0f172a;
    /* Aligned with the logo, which spans the block and is centered. */
    text-align: center;
}

.ob-login__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form fields */
.ob-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ob-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
}

.ob-input {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ob-input:focus {
    outline: none;
    border-color: #026aa7;
    box-shadow: 0 0 0 3px rgba(2, 106, 167, 0.1);
}

/* Buttons */
.ob-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ob-button--primary {
    background: #026aa7;
    color: white;
}

.ob-button--primary:hover {
    background: #01509f;
    transform: translateY(-1px);
}

.ob-button--block {
    width: 100%;
}

.ob-button:active {
    transform: translateY(0);
}

/* Links + footer */
.ob-login__footer-links {
    text-align: center;
}

.ob-login__footer-note {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ob-link {
    color: #026aa7;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.2s;
}

.ob-link:hover {
    color: #01509f;
    text-decoration: underline;
}

.ob-text-muted {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Alerts. ObelioCore's core_screens.css declares a different .ob-alert, but
   the two never meet: that one lives inside the cascade layers and this page
   does not load the bundle. */
.ob-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid;
}

.ob-alert--danger {
    background: #fee2e2;
    border-color: #dc2626;
    color: #7f1d1d;
}

.ob-alert--success {
    background: #dcfce7;
    border-color: #16a34a;
    color: #15803d;
}

/* Responsive — tablet (768px) */
@media (max-width: 768px) {
    .ob-login__container {
        flex-direction: column;
    }

    .ob-login__splash {
        flex: 0 0 auto;
        min-height: 250px;
    }

    .ob-login__form-wrapper {
        flex: 0 0 auto;
        padding: 1.5rem;
    }

    .ob-login__slogan {
        font-size: 1rem;
    }

    .ob-login__form-title {
        font-size: 1.5rem;
    }
}

/* Responsive — mobile (375px) */
@media (max-width: 375px) {
    .ob-login__splash {
        padding: 1rem;
    }

    .ob-login__logo {
        max-height: 60px;
    }

    .ob-login__title {
        font-size: 1.75rem;
    }

    .ob-login__form-wrapper {
        padding: 1rem;
    }

    .ob-login__form-container {
        max-width: 100%;
    }

    .ob-login__form-title {
        font-size: 1.25rem;
    }
}

/* Dark mode (if enabled) */
@media (prefers-color-scheme: dark) {
    body.ob-login {
        background: #1e293b;
    }

    .ob-login__form-wrapper {
        background: #0f172a;
    }

    .ob-login__form-title {
        color: #f8fafc;
    }

    .ob-label {
        color: #e2e8f0;
    }

    .ob-input {
        background: #1e293b;
        border-color: #334155;
        color: #f8fafc;
    }

    .ob-input:focus {
        border-color: #4f46e5;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }
}
