﻿/*
  Pantalla de ingreso: layout en dos columnas (marca a la izquierda, formulario a la derecha).
  Usa variables de _ThemeVariables.cshtml (--sm-color-primary / --sm-color-secondary).
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body.sm-login-page {
    margin: 0;
    min-height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1d21;
    background: #f0f2f5;
}

.sm-login-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
}

/* Panel izquierdo: marca sobre fondo primary (sin imagen) */
.sm-login-brand {
    flex: 1 1 45%;
    min-height: 220px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem 2.75rem;
    color: #fff;
    overflow: hidden;
    background-color: var(--sm-color-primary, #337ab7);
    background-image:
        radial-gradient(ellipse 110% 85% at 8% 12%, rgba(255, 255, 255, 0.22) 0%, transparent 52%),
        radial-gradient(circle at 92% 88%, rgba(0, 0, 0, 0.2) 0%, transparent 42%),
        radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 35%),
        linear-gradient(155deg, rgba(255, 255, 255, 0.14) 0%, transparent 42%, rgba(0, 0, 0, 0.12) 100%);
}

.sm-login-brand::before {
    content: "";
    position: absolute;
    inset: -15% -20%;
    opacity: 0.45;
    background: repeating-linear-gradient(
        -18deg,
        transparent,
        transparent 22px,
        rgba(255, 255, 255, 0.04) 22px,
        rgba(255, 255, 255, 0.04) 24px
    );
    pointer-events: none;
}

.sm-login-brand::after {
    content: "";
    position: absolute;
    right: -30%;
    top: -20%;
    width: 70%;
    height: 90%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 68%);
    pointer-events: none;
}

.sm-login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 28rem;
}

.sm-login-brand h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.sm-login-brand p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.92;
    line-height: 1.45;
}

.sm-login-brand-badge {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Panel derecho: acceso */
.sm-login-panel {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, #f8f9fb 0%, #eef1f5 100%);
}

.sm-login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem 2rem 1.75rem;
    background: #fff;
    border-radius: 12px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 12px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.sm-login-card-header {
    margin-bottom: 1.5rem;
}

.sm-login-card-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.sm-login-card-header .sm-login-sub {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.sm-login-form .form-group {
    margin-bottom: 1.1rem;
}

.sm-login-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.sm-login-form .form-control {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #111827;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sm-login-form .form-control:focus {
    border-color: var(--sm-color-primary, #337ab7);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(51, 122, 183, 0.2);
}

.sm-login-form textarea.form-control {
    height: auto;
    min-height: 42px;
}

.sm-login-form .field-validation-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: #b91c1c;
}

/* Turnstile (Cloudflare): alineado al eje del formulario como usuario / contraseña / Ingresar */
.sm-login-turnstile {
    margin: 1rem 0 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sm-login-turnstile iframe {
    max-width: 100%;
}

.sm-login-validation-summary {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    list-style: none;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.sm-login-validation-summary ul {
    margin: 0;
    padding-left: 1.1rem;
}

.sm-login-actions {
    margin-top: 0.25rem;
}

.sm-login-actions .btn-login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background-color: var(--sm-color-primary, #337ab7);
    border: 1px solid var(--sm-color-primary, #337ab7);
    border-radius: 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.sm-login-actions .btn-login-submit:hover,
.sm-login-actions .btn-login-submit:focus {
    background-color: var(--sm-color-secondary, #286090);
    border-color: var(--sm-color-secondary, #286090);
    color: #fff;
    outline: none;
}

.sm-login-actions .btn-login-submit:active {
    transform: translateY(1px);
}

.sm-login-footer {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    text-align: center;
    font-size: 0.8125rem;
    color: #9ca3af;
}

@media (max-width: 767px) {
    .sm-login-shell {
        flex-direction: column;
    }

    .sm-login-brand {
        flex: 0 0 auto;
        min-height: 200px;
        justify-content: center;
        text-align: center;
    }

    .sm-login-brand-inner {
        max-width: none;
    }

    .sm-login-panel {
        flex: 1 1 auto;
        align-items: flex-start;
        padding-top: 1.5rem;
    }

    .sm-login-card {
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }
}
