/**
 * Estilos de autenticación Coongro
 *
 * @package Coongro_Connector
 */

/* Reset y base — solo background en body para no afectar header/footer */
.coongro-auth-page {
    background: #FFFFFF;
}

/* Scoped reset — solo dentro del contenedor auth */
.coongro-auth-container *,
.coongro-auth-container *::before,
.coongro-auth-container *::after {
    box-sizing: border-box;
}

/* Contenedor principal - Split screen (alignfull rompe el contentSize del tema) */
.coongro-auth-container {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 100px);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1C1B1F;
}

/* Forzar full-width aunque alignfull no se aplique correctamente */
.coongro-auth-container.alignfull {
    width: 100vw !important;
    max-width: none !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* Lado izquierdo - Imagen decorativa */
.coongro-auth-left {
    flex: 0 0 35%;
    max-width: 35%;
    padding: 24px;
    padding-left: 80px;
    background: #FFFFFF;
    overflow: hidden;
}

.coongro-auth-left__img {
    display: block;
    width: 100%;
    height: calc(100vh - 200px);
    max-height: 700px;
    object-fit: cover;
    border-radius: 30px;
    animation: coongro-img-reveal 0.8s ease both;
}

@keyframes coongro-img-reveal {
    from {
        opacity: 0;
        transform: scale(1.04);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* Placeholder de imagen (para páginas sin foto aún) */
.coongro-auth-left__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: 30px;
    background: linear-gradient(135deg, #5a9a87 0%, #7DB09F 25%, #A7DFD3 50%, #FFC633 75%, #e8a820 100%);
}

/* Lado derecho - Formulario */
.coongro-auth-right {
    flex: 1;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* Layout espejo para registro: formulario izquierda, imagen derecha */
.coongro-auth-container--reverse .coongro-auth-left {
    padding-left: 24px;
    padding-right: 80px;
}

/* Wrapper del formulario */
.coongro-auth-form-wrapper {
    width: 100%;
    max-width: 420px;
}

/* Header */
.coongro-auth-header {
    margin-bottom: 24px;
}

.coongro-auth-header h1 {
    font-family: 'Noto Serif JP', serif;
    font-weight: 900;
    font-size: 32px;
    line-height: 38px;
    color: #000000;
    margin: 0 0 8px 0;
}

.coongro-auth-header p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    color: #707070;
    margin: 0;
}

/* Mensajes de error/éxito */
.coongro-auth-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.coongro-auth-message--error {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.coongro-auth-message--success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

/* Formulario */
.coongro-auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Filas de campos */
.coongro-auth-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.coongro-auth-row--two .coongro-auth-field {
    flex: 1;
}

/* Campos */
.coongro-auth-field {
    position: relative;
    flex: 1;
}

.coongro-auth-field input {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #1C1B1F;
    background: #FFFFFF;
    border: 1px solid #D4D4CE;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.coongro-auth-field input:focus {
    border-color: #7DB09F;
    box-shadow: 0 0 0 2px rgba(125, 176, 159, 0.2);
}

.coongro-auth-field input:focus + label {
    color: #7DB09F;
}

.coongro-auth-field input.has-error {
    border-color: #C62828;
}

.coongro-auth-field input.has-error:focus {
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.2);
}

/* Labels siempre arriba */
.coongro-auth-field label {
    position: absolute;
    top: -8px;
    left: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: 15px;
    color: #707070;
    pointer-events: none;
    background: #FFFFFF;
    padding: 0 2px;
}

/* Campo con botón de mostrar/ocultar contraseña */
.coongro-auth-field--password input {
    padding-right: 48px;
}

.coongro-auth-toggle-password {
    position: absolute;
    top: 20px;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #707070;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coongro-auth-toggle-password:hover {
    color: #1C1B1F;
}

/* Errores de campo */
.coongro-auth-field-error {
    display: block;
    font-size: 12px;
    color: #C62828;
    margin-top: 4px;
    min-height: 16px;
}

/* Fila con elementos separados (justify-between) */
.coongro-auth-row--between {
    justify-content: space-between;
    align-items: center;
}

/* Checkbox */
.coongro-auth-checkbox {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.coongro-auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 2px 0 0 0;
    accent-color: #7DB09F;
    cursor: pointer;
    flex-shrink: 0;
}

.coongro-auth-checkbox label {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #000000;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
}

.coongro-auth-checkbox label a {
    color: #7DB09F;
    text-decoration: underline;
}

.coongro-auth-checkbox label a:hover {
    color: #5C8F7F;
}

.coongro-auth-checkbox .coongro-auth-field-error {
    width: 100%;
    margin-left: 24px;
}

/* En fila --between, el checkbox no debe tener flex-wrap */
.coongro-auth-row--between .coongro-auth-checkbox {
    flex-wrap: nowrap;
    flex: none;
}

/* Link de texto */
.coongro-auth-link {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #7DB09F;
    text-decoration: none;
    white-space: nowrap;
}

.coongro-auth-link:hover {
    text-decoration: underline;
    color: #5C8F7F;
}

/* Botones */
.coongro-auth-actions {
    margin-top: 8px;
}

.coongro-auth-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 34px;
    padding: 8px 10px;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.coongro-auth-btn--primary {
    background: #FFC633;
    color: #000000;
}

.coongro-auth-btn--primary:hover {
    background: #E6B22E;
}

.coongro-auth-btn--primary:active {
    background: #CC9E29;
}

.coongro-auth-btn--primary:disabled {
    background: #E5E5E5;
    color: #9E9E9E;
    cursor: not-allowed;
}

.coongro-auth-btn--primary.is-loading {
    background: #E6B22E;
    color: #000000;
    cursor: wait;
}

/* Spinner */
.coongro-auth-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #000000;
    animation: coongro-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes coongro-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Botón outline (secundario) */
.coongro-auth-btn--outline {
    background: transparent;
    color: #707070;
    border: 1px solid #D4D4CE;
}

.coongro-auth-btn--outline:hover:not(:disabled) {
    background: #F5F5F5;
    color: #1C1B1F;
    border-color: #B7B7B7;
}

.coongro-auth-btn--outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coongro-auth-btn--outline svg {
    flex-shrink: 0;
}

/* Sección de reenvío */
.coongro-auth-resend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 16px;
}

.coongro-auth-resend__text {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #707070;
    margin: 0;
}

.coongro-auth-resend .coongro-auth-form {
    width: 100%;
}

.coongro-auth-btn--google {
    background: #FFFFFF;
    color: #000000;
    border: 1px solid #D4D4CE;
}

.coongro-auth-btn--google:hover:not(:disabled) {
    background: #F5F5F5;
}

.coongro-auth-btn--google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.coongro-auth-btn--google svg {
    flex-shrink: 0;
}

/* Divisor */
.coongro-auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.coongro-auth-divider::before,
.coongro-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #B7B7B7;
}

.coongro-auth-divider span {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #B7B7B7;
    white-space: nowrap;
}

/* Social login */
.coongro-auth-social {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Estilos para el botón de Nextend Social Login */
.coongro-auth-social .nsl-container {
    width: 100%;
}

.coongro-auth-social .nsl-container-buttons {
    display: flex;
    justify-content: center;
}

.coongro-auth-social .nsl-button {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 48px !important;
    padding: 8px 16px !important;
    gap: 10px !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    border: 1px solid #707070 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

.coongro-auth-social .nsl-button:hover {
    background: #F5F5F5 !important;
}

/* Wrapper centrado (para flujo de recuperación) */
.coongro-auth-form-wrapper--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.coongro-auth-form-wrapper--centered .coongro-auth-form {
    width: 100%;
}

/* Header centrado */
.coongro-auth-header--centered {
    text-align: center;
}

.coongro-auth-header--centered p {
    text-align: center;
}

/* Icono de email enviado — círculo con sobre + badge check */
.coongro-auth-sent-icon {
    position: relative;
    margin-bottom: 16px;
}

.coongro-auth-sent-icon__circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #EDF7F4;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: coongro-fade-in 0.4s ease;
}

.coongro-auth-sent-icon__badge {
    position: absolute;
    bottom: 0;
    right: -4px;
    width: 24px;
    height: 24px;
    background: #7DB09F;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
    animation: coongro-pop-in 0.3s ease 0.2s both;
}

@keyframes coongro-fade-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes coongro-pop-in {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* Email pill */
.coongro-auth-email-pill {
    display: inline-block;
    padding: 6px 16px;
    background: #EDF7F4;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #5a9a87;
    letter-spacing: 0.2px;
}

/* Hint de requisitos (ej: "Mínimo 8 caracteres") */
.coongro-auth-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #999;
    margin: 0;
}

.coongro-auth-hint svg {
    flex-shrink: 0;
    color: #B7B7B7;
}

/* Link con flecha para volver */
.coongro-auth-link--back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Footer */
.coongro-auth-footer {
    margin-top: 16px;
    text-align: center;
}

.coongro-auth-footer p {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #707070;
    margin: 0;
}

.coongro-auth-footer a {
    color: #7DB09F;
    font-weight: 500;
    text-decoration: none;
}

.coongro-auth-footer a:hover {
    text-decoration: underline;
}

/* ======================= */
/* RESPONSIVE - Mobile     */
/* ======================= */
@media (max-width: 768px) {
    .coongro-auth-container.alignfull {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .coongro-auth-container {
        flex-direction: column;
    }

    /* En registro (reverse), reordenar para que imagen vaya arriba en mobile */
    .coongro-auth-container--reverse {
        flex-direction: column-reverse;
    }

    /* Imagen como banner horizontal en móvil */
    .coongro-auth-left {
        flex: 0 0 auto;
        max-width: 100%;
        padding: 16px;
    }

    .coongro-auth-left__img {
        max-height: 200px;
        width: 100%;
        border-radius: 16px;
    }

    .coongro-auth-left__placeholder {
        min-height: 150px;
        border-radius: 16px;
    }

    .coongro-auth-right {
        flex: 1;
        padding: 24px 16px;
        justify-content: flex-start;
    }

    .coongro-auth-form-wrapper {
        max-width: 100%;
        min-width: auto;
    }

    .coongro-auth-header h1 {
        font-size: 28px;
        line-height: 36px;
    }

    /* Campos en columna en móvil */
    .coongro-auth-row--two {
        flex-direction: column;
        gap: 16px;
    }
}

/* ======================= */
/* TABLET                  */
/* ======================= */
@media (min-width: 769px) and (max-width: 1024px) {
    .coongro-auth-left {
        flex: 0 0 30%;
        max-width: 30%;
        padding: 16px;
        padding-left: 24px;
    }

    .coongro-auth-container--reverse .coongro-auth-left {
        padding-left: 16px;
        padding-right: 24px;
    }

    .coongro-auth-container--reverse .coongro-auth-right {
        padding-left: 40px;
    }

    .coongro-auth-left__img {
        max-height: 500px;
    }
}

/* ======================= */
/* DESKTOP PEQUEÑO         */
/* ======================= */
@media (min-width: 1025px) and (max-width: 1366px) {
    .coongro-auth-left {
        padding-left: 40px;
    }

    .coongro-auth-container--reverse .coongro-auth-left {
        padding-left: 24px;
        padding-right: 40px;
    }

    .coongro-auth-container--reverse .coongro-auth-right {
        padding-left: 40px;
    }

    .coongro-auth-left__img {
        max-height: 600px;
    }
}

/* ======================= */
/* VERIFICATION NOTICES    */
/* ======================= */
.coongro-verification-notice {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.coongro-verification-notice p {
    margin: 0;
}

.coongro-verification-notice--warning {
    background-color: #FFF8E1;
    border: 1px solid #FFE082;
    color: #F57C00;
}

.coongro-verification-notice--error {
    background-color: #FFEBEE;
    border: 1px solid #EF9A9A;
    color: #C62828;
}

.coongro-verification-notice--success {
    background-color: #E8F5E9;
    border: 1px solid #A5D6A7;
    color: #2E7D32;
}

.coongro-verification-notice--info {
    background-color: #E3F2FD;
    border: 1px solid #90CAF9;
    color: #1565C0;
}

.coongro-verification-notice__content {
    flex: 1;
}

.coongro-verification-notice__action {
    flex-shrink: 0;
}

.coongro-verification-resend-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #FFC633;
    color: #000000;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.coongro-verification-resend-btn:hover {
    background-color: #E6B22E;
}

@media (max-width: 600px) {
    .coongro-verification-notice {
        flex-direction: column;
        align-items: flex-start;
    }

    .coongro-verification-notice__action {
        width: 100%;
    }

    .coongro-verification-resend-btn {
        width: 100%;
        text-align: center;
    }
}
