/* =================================== */
/* ====== ESTILOS COMPARTIDOS (Fondo y Overlay) ===== */
/* =================================== */
body {
    font-family: 'Roboto-Black', sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    min-height: 100vh;
}

video.background {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    z-index: -1;
    background: #000;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 0;
}

.register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* =================================== */
/* ====== TARJETA DE REGISTRO (register-box) ===== */
/* =================================== */
.register-box {
    background: #ffffff;
    padding: 40px;
    border-radius: 14px;
    width: 650px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    text-align: center;
    box-sizing: border-box;
}

.register-box h1 {
    color: #2068bc;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 800;
}

/* =================================== */
/* ====== PANEL GRID (h:panelGrid) - AJUSTES DE ALINEACIÓN FINAL ===== */
/* =================================== */

.form-grid {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

/* 1. Estilo para la celda de la etiqueta (.label) */
.form-grid .label {
    /* Mantenemos el nombre de clase que usa tu código antiguo: 'label' */
    width: 40%; /* Aumentamos el ancho de la etiqueta para "Confirmar Contraseña" */
    padding: 10px 10px 10px 0;
    vertical-align: middle;
    text-align: right;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}

/* 2. Estilo para la celda del input (.input) */
.form-grid .input {
    /* Mantenemos el nombre de clase que usa tu código antiguo: 'input' */
    width: 60%;
    padding: 5px 0 5px 10px;
    vertical-align: middle;
    text-align: left; /* Asegura que el contenido interno se alinee a la izquierda */
}

/* Estilo para los inputs y selects DENTRO de la celda .input */
.form-grid .input input,
.form-grid .input select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f5f5f5;
    font-size: 16px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

/* Arreglo para select */
.form-grid .input select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="gray" d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 16px;
}

/* Estilo para los mensajes de error individuales (que están dentro de la celda .input) */
.error-message {
    color: red;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* =================================== */
/* ====== PASSWORD WRAPPER (CORRECCIÓN DE ALINEACIÓN) ===== */
/* =================================== */
.password-wrapper {
    position: relative;
    /* La clase .input ya está en el TD, no necesitamos ancho 100% aquí */
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    /* Aplicamos el estilo de input directamente al h:inputSecret */
    width: 100%;
    padding-right: 40px; /* Espacio para el ojo */
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f5f5f5;
    box-sizing: border-box;
    /* QUITAMOS el padding del input padre para evitar conflicto */
}

.toggle-password {
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    padding: 5px;
    line-height: 1;
    z-index: 1;
}

/* =================================== */
/* ====== GESTIÓN DE MENSAJES GLOBALES Y BOTONES ===== */
/* =================================== */
.button {
    background-color: #4285f4;
    color: #fff;
    border: none;
    padding: 12px 45px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 25px;
    margin: 25px 0 10px 0;
    transition: background-color 0.3s ease;
    font-size: 16px;
}
.full-width {
    width: 100%;
}
.messages {
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}
.messages td {
    border: none;
}
.messages .ui-messages-error {
    color: red;
    background-color: #ffe0e0;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ff4d4d;
}
.btn-login {
    color: #4285f4;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 0;
    display: block;
    cursor: pointer;
    font-size: 14px;
}

/* =================================== */
/* ====== MEDIA QUERY (h:panelGrid) - SOLUCIÓN PARA MÓVIL ===== */
/* =================================== */

@media (max-width: 650px) {
    .register-box {
        padding: 30px 20px;
        width: 100%;
    }

    /* Forzamos que la tabla se comporte como una columna vertical de bloques */
    .form-grid, .form-grid tbody, .form-grid tr, .form-grid td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Estilos de las celdas apiladas */
    .form-grid .label {
        width: 100% !important;
        text-align: left; /* Alineamos etiquetas a la izquierda en móvil */
        padding: 15px 0 5px 0;
        font-weight: 400; /* Menor peso en móvil */
    }

    .form-grid .input {
        width: 100% !important;
        padding: 0 0 10px 0; /* Padding solo abajo */
    }

    /* El input wrapper debe ocupar el 100% sin padding */
    .password-wrapper {
        width: 100%;
    }

    .error-message {
        padding-left: 0;
        margin-bottom: 15px;
    }
}