/* ==========================================================================
   BitoAgro SAS — Hoja de estilos del módulo de Identidad (Identity)
   --------------------------------------------------------------------------
   Autocontenida: NO depende de Bootstrap ni de fuentes/iconos externos.
   Las vistas de Identity cargan únicamente este archivo, por lo que la
   primera pintura no queda bloqueada por peticiones de red externas.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables corporativas
   -------------------------------------------------------------------------- */
:root {
    /* Paleta corporativa */
    --color-primary: #2E6F40; /* Verde principal */
    --color-primary-dark: #235431; /* Verde hover / activo */
    --color-primary-soft: rgba(46, 111, 64, 0.12); /* Halo de foco */
    --color-secondary: #8B5A2B; /* Tierra / detalles */
    --color-secondary-dark: #704822;
    --color-bg: #F4F6F4; /* Fondo suave */
    --color-white: #FFFFFF;
    --color-text: #2D3748;
    --color-text-muted: #718096;
    --color-border: #CBD5E1;
    --color-border-soft: #E2E8F0;
    /* Estados */
    --color-success: #10B981;
    --color-success-bg: #F0FDF4;
    --color-success-border: #BBF7D0;
    --color-success-text: #166534;
    --color-danger: #DC2626;
    --color-danger-bg: #FEF2F2;
    --color-danger-border: #FCA5A5;
    --color-danger-text: #991B1B;
    /* Forma y movimiento */
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -8px rgba(16, 24, 40, .12);
    --shadow-btn: 0 1px 2px rgba(35, 84, 49, .24);
    --transition: 180ms cubic-bezier(.4, 0, .2, 1);
    --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   2. Reset acotado + lienzo
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body.identity-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text);
    background-color: var(--color-bg);
    /* Ambiente corporativo sutil: dos halos en verde y tierra sobre el fondo */
    background-image: radial-gradient(60rem 34rem at 12% -10%, rgba(46, 111, 64, .10), transparent 62%), radial-gradient(48rem 30rem at 108% 106%, rgba(139, 90, 43, .10), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. Estructura: envoltorio centrado + tarjeta
   -------------------------------------------------------------------------- */
.identity-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.identity-card {
    width: 100%;
    max-width: 440px;
    background-color: var(--color-white);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 40px 36px 32px;
    position: relative;
    overflow: hidden;
}

    /* Filete superior corporativo */
    .identity-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary) 62%, var(--color-secondary) 100%);
    }

/* --------------------------------------------------------------------------
   4. Marca y encabezados
   -------------------------------------------------------------------------- */
.identity-brand {
    text-align: center;
    margin-bottom: 28px;
}

.identity-brand-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--color-white);
    background: linear-gradient(145deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    box-shadow: 0 6px 16px -6px rgba(46, 111, 64, .55);
}

    .identity-brand-mark svg {
        width: 30px;
        height: 30px;
        display: block;
    }

.identity-brand-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--color-text);
}

.identity-brand-tag {
    margin: 2px 0 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.identity-header {
    text-align: center;
    margin-bottom: 24px;
}

.identity-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: var(--color-text);
}

.identity-subtitle {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   5. Formularios — campos con etiqueta flotante (sin dependencias)
   Requiere placeholder=" " en el input para que funcione :placeholder-shown.
   -------------------------------------------------------------------------- */
.identity-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    position: relative;
}

.field-input {
    width: 100%;
    height: 56px;
    padding: 22px 14px 8px;
    font-family: inherit;
    font-size: 15px;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

    .field-input::placeholder {
        color: transparent;
    }

    .field-input:hover:not(:focus) {
        border-color: #A9B6C6;
    }

    .field-input:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 4px var(--color-primary-soft);
    }

.field-label {
    position: absolute;
    top: 17px;
    left: 15px;
    font-size: 15px;
    color: var(--color-text-muted);
    pointer-events: none;
    transform-origin: 0 0;
    transition: transform var(--transition), color var(--transition);
}

.field-input:focus ~ .field-label,
.field-input:not(:placeholder-shown) ~ .field-label {
    transform: translateY(-11px) scale(.75);
}

.field-input:focus ~ .field-label {
    color: var(--color-primary);
}

/* Campo en estado inválido (lo marca jquery-validation) */
.field-input.input-validation-error {
    border-color: var(--color-danger);
}

    .field-input.input-validation-error:focus {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
    }

/* --------------------------------------------------------------------------
   6. Casilla de verificación
   -------------------------------------------------------------------------- */
.field-check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: -2px 0 2px;
}

.field-check-input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex: none;
}

.field-check-label {
    font-size: 13.5px;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
}

/* --------------------------------------------------------------------------
   7. Botones
   -------------------------------------------------------------------------- */
.identity-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.identity-btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-btn);
}

    .identity-btn--primary:hover {
        background-color: var(--color-primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 6px 14px -4px rgba(35, 84, 49, .45);
    }

    .identity-btn--primary:active {
        transform: translateY(0);
        box-shadow: none;
    }

.identity-btn--outline {
    background-color: transparent;
    color: var(--color-secondary);
    border-color: var(--color-secondary);
}

    .identity-btn--outline:hover {
        background-color: rgba(139, 90, 43, .07);
        color: var(--color-secondary-dark);
        border-color: var(--color-secondary-dark);
    }

.identity-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.identity-btn[disabled],
.identity-btn.is-busy {
    opacity: .65;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   8. Enlaces y pie de la tarjeta
   -------------------------------------------------------------------------- */
.identity-link {
    color: var(--color-secondary);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition);
}

    .identity-link:hover {
        color: var(--color-primary);
        text-decoration: underline;
    }

.identity-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-soft);
    text-align: center;
}

.identity-footnote {
    margin: 22px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   9. Alertas, validación y estados de resultado
   -------------------------------------------------------------------------- */
.identity-alert {
    display: block;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 13.5px;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.identity-alert--error {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger-text);
}

.identity-alert--success {
    background-color: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
}

.identity-alert ul {
    margin: 0;
    padding-left: 18px;
}

/* asp-validation-summary imprime el contenedor aunque no haya errores */
.identity-alert:empty {
    display: none;
}

.identity-alert.validation-summary-valid {
    display: none;
}

/* Mensaje de validación por campo */
.field-error {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--color-danger);
}

    .field-error:empty {
        display: none;
    }

/* Pantallas de resultado (confirmaciones, verificación de correo) */
.identity-state {
    text-align: center;
}

.identity-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

    .identity-state-icon svg {
        width: 32px;
        height: 32px;
        display: block;
    }

    .identity-state-icon--success {
        background-color: var(--color-success-bg);
        border: 1px solid var(--color-success-border);
        color: var(--color-success-text);
    }

    .identity-state-icon--info {
        background-color: rgba(46, 111, 64, .08);
        border: 1px solid rgba(46, 111, 64, .22);
        color: var(--color-primary);
    }

    .identity-state-icon--error {
        background-color: var(--color-danger-bg);
        border: 1px solid var(--color-danger-border);
        color: var(--color-danger-text);
    }

.identity-state-text {
    margin: 0 0 8px;
    font-size: 14.5px;
    color: var(--color-text);
}

.identity-state-hint {
    margin: 0;
    font-size: 12.5px;
    color: var(--color-text-muted);
}

.identity-state .identity-btn {
    margin-top: 26px;
}

/* --------------------------------------------------------------------------
   10. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .identity-wrapper {
        padding: 24px 16px;
    }

    .identity-card {
        padding: 32px 22px 26px;
        border-radius: var(--radius);
    }
}

/* --------------------------------------------------------------------------
   11. Accesibilidad — respeto por "reducir movimiento"
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
