/* =============================================
   REGISTRO DE PRODUCTOR - AGROCOM
   Diseño igual a Autenticacion.css
   ============================================= */

:root {
    --verde-principal: #198754;
    --verde-oscuro: #0d5c38;
    --verde-claro: #eaf7ef;
    --verde-suave: #bfe4cc;
    --amarillo: #f6c945;
    --amarillo-claro: #fff3b8;
    --blanco: #ffffff;
    --texto: #24332b;
    --texto-suave: #65736b;
    --borde: #dce8e0;
    --error: #c0392b;
    --exito: #198754;
}

/* Reinicio básico */

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    padding: 20px;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--texto);

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(246, 201, 69, 0.24) 0,
            rgba(246, 201, 69, 0.24) 120px,
            transparent 121px
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(25, 135, 84, 0.18) 0,
            rgba(25, 135, 84, 0.18) 170px,
            transparent 171px
        ),
        linear-gradient(135deg, #f4fff7 0%, #fffbee 100%);

    background-attachment: fixed;
}

/* Contenedor principal centrado */

.pagina-registro {
    width: 100%;
    min-height: calc(100vh - 40px);

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.contenedor-principal {
    width: 100%;
    max-width: 450px;
    margin-top: auto;
    margin-bottom: auto;
}

#compatibilidadListado {
    display: none !important;
}

/* Tarjeta */

.panel-formulario {
    position: relative;
    width: 100%;
    max-width: 450px;
    padding: 38px 42px 30px;

    background-color: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(25, 135, 84, 0.16);
    border-top: 7px solid var(--amarillo);
    border-radius: 24px;

    box-shadow:
        0 22px 55px rgba(13, 92, 56, 0.16),
        0 5px 15px rgba(0, 0, 0, 0.06);

    overflow: hidden;
}

/* Decoración interior */

.panel-formulario::before {
    content: "";
    position: absolute;
    top: -75px;
    right: -75px;

    width: 170px;
    height: 170px;

    border-radius: 50%;
    background-color: rgba(246, 201, 69, 0.13);
    pointer-events: none;
}

.panel-formulario::after {
    content: "";
    position: absolute;
    bottom: -95px;
    left: -95px;

    width: 190px;
    height: 190px;

    border-radius: 50%;
    background-color: rgba(25, 135, 84, 0.08);
    pointer-events: none;
}

.panel-formulario > * {
    position: relative;
    z-index: 1;
}

/* Logo */

.logo-agrocom {
    position: relative;
    z-index: 1;

    width: 92px;
    height: 92px;
    margin: -3px auto 13px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: linear-gradient(145deg, #ffffff, var(--verde-claro));
    border: 3px solid var(--amarillo);
    border-radius: 50%;

    box-shadow:
        0 8px 20px rgba(25, 135, 84, 0.18),
        0 0 0 7px rgba(246, 201, 69, 0.12);
}

.logo-agrocom svg {
    width: 72px;
    height: 72px;
}

.logo-agrocom circle {
    fill: transparent;
    stroke: transparent;
}

.logo-agrocom .tallo {
    fill: none;
    stroke: var(--verde-oscuro);
    stroke-width: 6;
    stroke-linecap: round;
}

.logo-agrocom .hoja {
    fill: var(--verde-principal);
}

.logo-agrocom .hoja-derecha {
    fill: #43a85f;
}

/* Encabezado */

.encabezado-productor {
    position: relative;
    z-index: 1;
    text-align: center;
}

.nombre-marca {
    margin: 0;
    color: var(--verde-oscuro);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1;
}

.nombre-marca span {
    color: #e3ad08;
}

.bienvenida {
    margin: 12px 0 6px;
    color: var(--texto);
    font-size: 24px;
    font-weight: 750;
}

.subtitulo {
    margin: 0;
    color: var(--texto-suave);
    font-size: 14px;
    line-height: 1.5;
}

/* Separador del título */

.separador-titulo {
    margin: 24px 0 18px;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
}

.separador-titulo span {
    flex: 1;
    height: 1px;

    background: linear-gradient(
        to right,
        transparent,
        var(--verde-suave)
    );
}

.separador-titulo span:last-child {
    background: linear-gradient(
        to left,
        transparent,
        var(--verde-suave)
    );
}

#tituloFormulario {
    margin: 0;
    color: var(--verde-oscuro);
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

/* Formulario */

#formProductor {
    position: relative;
    z-index: 1;
}

.grupo-formulario {
    margin-bottom: 20px;
}

.grupo-formulario > label {
    display: block;
    margin-bottom: 8px;

    color: var(--verde-oscuro);
    font-size: 14px;
    font-weight: 700;
}

/* Inputs con icono */

.contenedor-input {
    position: relative;
    display: flex;
    align-items: center;
}

.icono-input {
    position: absolute;
    left: 15px;
    z-index: 2;

    color: var(--verde-principal);
    font-size: 17px;
    pointer-events: none;
}

.contenedor-input input,
.contenedor-input select {
    width: 100%;
    height: 50px;
    padding: 0 46px;

    color: var(--texto);
    font-family: inherit;
    font-size: 15px;

    background-color: #fbfefc;
    border: 2px solid var(--borde);
    border-radius: 12px;
    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.contenedor-input select {
    padding-right: 14px;
    cursor: pointer;
}

.contenedor-input input::placeholder {
    color: #9aa79f;
}

.contenedor-input input:hover,
.contenedor-input select:hover {
    border-color: var(--verde-suave);
}

.contenedor-input input:focus,
.contenedor-input select:focus {
    background-color: var(--blanco);
    border-color: var(--verde-principal);
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.12);
}

/* Foto de perfil */

.seccion-foto-productor {
    margin: 2px 0 24px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.contenedor-foto-productor {
    width: 120px;
    height: 120px;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: var(--verde-claro);
    border: 3px solid var(--amarillo);
    border-radius: 50%;

    box-shadow:
        0 8px 20px rgba(25, 135, 84, 0.18),
        0 0 0 7px rgba(246, 201, 69, 0.12);

    overflow: hidden;
}

.vista-previa-foto {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.sin-foto-productor {
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: var(--verde-claro);
    font-size: 46px;
}

.input-foto {
    display: none;
}

/* Overlay de la foto de perfil */

.contenedor-foto-productor {
    position: relative;
}

.overlay-foto-productor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: rgba(0, 0, 0, 0.45);

    opacity: 0;
    cursor: pointer;

    transition: opacity 0.2s ease;
}

.contenedor-foto-productor:hover .overlay-foto-productor {
    opacity: 1;
}

.overlay-foto-productor i {
    color: white;
    font-size: 32px;
}

/*MENU*/

.menu-foto-productor {
    display: none;

    margin-top: 10px;

    width: 180px;

    background: white;
    border-radius: 10px;

    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);

    overflow: hidden;
}

.menu-foto-productor.mostrar {
    display: flex;
    flex-direction: column;
}

.menu-foto-productor button {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    padding: 11px 14px;

    border: none;
    background: white;

    cursor: pointer;
    text-align: left;

    font-size: 14px;

    transition: background-color 0.2s ease;
}

.menu-foto-productor button:hover {
    background-color: var(--verde-claro);
}

.menu-foto-productor i {
    font-size: 16px;
}

/*ver todo*/
.visor-foto-productor {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    padding: 30px;

    cursor: pointer;
}

.visor-foto-contenido {
    max-width: 90vw;
    max-height: 90vh;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: default;
}

.visor-foto-contenido img {
    max-width: 90vw;
    max-height: 90vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 8px;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.btn-seleccionar-foto {
    margin-top: 14px;
    padding: 10px 16px;

    display: inline-flex;
    justify-content: center;
    align-items: center;

    color: var(--blanco);
    font-size: 13px;
    font-weight: 800;

    background: linear-gradient(
        135deg,
        var(--verde-principal),
        var(--verde-oscuro)
    );

    border: none;
    border-radius: 10px;
    box-shadow: 0 7px 16px rgba(13, 92, 56, 0.22);
    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.btn-seleccionar-foto:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(13, 92, 56, 0.28);
    filter: brightness(1.05);
}

/* Botón para mostrar contraseña */

.btn-mostrar-contrasenia {
    position: absolute;
    right: 8px;
    z-index: 3;

    width: 37px;
    height: 37px;
    padding: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: transparent;
    border: none;
    border-radius: 9px;
    cursor: pointer;

    font-size: 17px;
    opacity: 0.65;

    transition:
        background-color 0.2s ease,
        opacity 0.2s ease,
        transform 0.2s ease;
}

.btn-mostrar-contrasenia:hover {
    background-color: var(--verde-claro);
    opacity: 1;
    transform: scale(1.05);
}

.btn-mostrar-contrasenia:focus-visible {
    outline: 3px solid rgba(246, 201, 69, 0.55);
}

/* Mensajes */

.mensaje-estado,
.mensaje-formulario {
    display: none;
}

.mensaje-estado:not(:empty) {
    display: block;
    width: 100%;
    max-width: 450px;
    margin: 0 0 15px;
    padding: 11px 13px;

    background-color: var(--blanco);
    border-radius: 9px;

    font-size: 13px;
    line-height: 1.4;
    text-align: left;

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.mensaje-formulario:not(:empty) {
    display: block;
    margin: 2px 0 15px;
    padding: 11px 13px;

    color: var(--error);
    background-color: #fff0ee;
    border: 1px solid #f2bbb4;
    border-left: 4px solid var(--error);
    border-radius: 9px;

    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.mensaje-estado.exito,
.mensaje-formulario.exito {
    color: var(--exito);
    background-color: #eaf8f0;
    border: 1px solid #b7dfc5;
    border-left: 4px solid var(--exito);
}

.mensaje-estado.error,
.mensaje-formulario.error {
    color: var(--error);
    background-color: #fff0ee;
    border: 1px solid #f2bbb4;
    border-left: 4px solid var(--error);
}

/* Ayudas y errores */

.ayuda-campo {
    display: block;
    margin-top: 7px;

    color: var(--texto-suave);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.ayuda-contrasenia {
    text-align: left;
}

.error {
    display: none;
}

.error:not(:empty) {
    display: block;
    margin-top: 5px;

    color: var(--error);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

/* Botones */

.acciones-formulario {
    margin-top: 24px;

    display: flex;
    gap: 11px;
}

.acciones-formulario .btn {
    flex: 1;
    min-height: 52px;
    padding: 13px 20px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.3px;

    border: none;
    border-radius: 13px;
    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.btn-primario {
    color: var(--blanco);

    background: linear-gradient(
        135deg,
        var(--verde-principal),
        var(--verde-oscuro)
    );

    box-shadow: 0 9px 20px rgba(13, 92, 56, 0.24);
}

.btn-primario::after {
    content: "→";
    margin-left: 9px;
    color: var(--amarillo);
    font-size: 19px;
}

.btn-secundario {
    color: var(--verde-oscuro);
    background-color: var(--amarillo-claro);
    border: 2px solid var(--amarillo) !important;
    box-shadow: 0 7px 16px rgba(246, 201, 69, 0.2);
}

.acciones-formulario .btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-primario:hover {
    box-shadow: 0 12px 25px rgba(13, 92, 56, 0.3);
}

.acciones-formulario .btn:active {
    transform: translateY(0);
}

.acciones-formulario .btn:focus-visible,
.btn-seleccionar-foto:focus-visible {
    outline: 4px solid rgba(246, 201, 69, 0.5);
    outline-offset: 3px;
}

.acciones-formulario .btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/*btn eliminar cuenta css*/
.accion-eliminar-cuenta {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.btn-eliminar-cuenta {
    background: transparent;
    border: none;
    color: #c0392b;
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-eliminar-cuenta:hover {
    color: #922b21;
    background: rgba(192, 57, 43, 0.08);
    text-decoration: none;
}

.btn-eliminar-cuenta:focus-visible {
    outline: 2px solid #c0392b;
    outline-offset: 2px;
}

/* Parte inferior */

.frase-agrocom {
    position: relative;
    z-index: 1;

    width: 75%;
    margin: 24px auto 0;
    padding-top: 15px;

    color: var(--verde-oscuro);
    font-size: 13px;
    font-weight: 700;
    text-align: center;

    border-top: 1px solid var(--verde-suave);
}

/* Diseño adaptable */

@media (max-width: 520px) {
    body {
        padding: 14px;
    }

    .pagina-registro {
        min-height: calc(100vh - 28px);
    }

    .panel-formulario {
        padding: 32px 23px 25px;
        border-radius: 20px;
    }

    .logo-agrocom {
        width: 80px;
        height: 80px;
    }

    .logo-agrocom svg {
        width: 62px;
        height: 62px;
    }

    .nombre-marca {
        font-size: 30px;
    }

    .bienvenida {
        font-size: 21px;
    }

    .acciones-formulario {
        flex-direction: column;
    }

    .acciones-formulario .btn {
        width: 100%;
    }
}

.contenedor-rol {
    margin-bottom: 24px;
}

.contenedor-rol > label {
    display: block;
    margin-bottom: 12px;

    color: var(--verde-oscuro);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.opciones-rol {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.opciones-rol label {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

    min-height: 64px;
    padding: 12px 10px;

    background-color: #fbfefc;
    border: 2px solid var(--borde);
    border-radius: 14px;
    cursor: pointer;

    color: var(--texto);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease,
        color 0.2s ease;
}

.opciones-rol label:hover {
    border-color: var(--verde-suave);
    transform: translateY(-2px);
}

.opciones-rol input[type="radio"] {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 15px;
    height: 15px;
    margin: 0;

    accent-color: var(--verde-principal);
    cursor: pointer;
}

/* Estado seleccionado */

.opciones-rol label:has(input:checked) {
    background-color: var(--verde-claro);
    border-color: var(--verde-principal);
    color: var(--verde-oscuro);
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.18);
}

.opciones-rol label:focus-within {
    outline: 3px solid rgba(246, 201, 69, 0.55);
    outline-offset: 2px;
}

/* Diseño adaptable */

@media (max-width: 520px) {
    .opciones-rol {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .opciones-rol label {
        justify-content: flex-start;
        text-align: left;
        padding: 12px 34px 12px 14px;
        min-height: auto;
    }
}