/* static/css/pre-register.css */
:root {
    --pr-navy-deep: #0a1526;
    --pr-navy-mid: #16264a;
    --pr-navy: #162640;
    --pr-red: #b61e25;
    --pr-red-dark: #7f151a;
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Header navy (mismo lenguaje que el navbar del sitio) ---------- */
.pr-header {
    background: var(--pr-navy-deep);
    padding: 18px 5%;
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.pr-header-logo img {
    height: 42px;
    width: auto;
    display: block;
}

/* ---------- Contenido principal ---------- */
.pr-main {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
}

.pr-bg-shape {
    position: absolute;
    top: -100px;
    right: -140px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(182, 30, 37, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    background-color: #ffffff;
    padding: 44px 40px;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(22, 38, 64, 0.1);
    border: 1px solid rgba(22, 38, 64, 0.06);
    max-width: 560px;
    width: 100%;
    text-align: center;
}

.pr-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pr-red);
    margin-bottom: 16px;
}

.pr-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--pr-red);
    display: inline-block;
}

.content h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--pr-navy);
    margin-bottom: 12px;
    line-height: 1.15;
}

.content p {
    font-size: 0.98rem;
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.6;
}

.content p strong {
    color: var(--pr-navy);
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

form input,
form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #dde2e8;
    border-radius: 12px;
    font-size: 1em;
    box-sizing: border-box;
    color: var(--pr-navy);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

form input:focus,
form select:focus {
    outline: none;
    border-color: var(--pr-navy-mid);
    box-shadow: 0 0 0 3px rgba(22, 38, 64, 0.08);
}

/* Validación (generada por security.js) -- nunca tuvo estilo propio, por
   eso salía con la tipografía cruda del navegador en vez de algo prolijo */
.input-error {
    border-color: #e74c3c !important;
}

/* Dentro de .select-group el input/select tiene border:none (el borde
   visible es el del contenedor) -- sin esto el borde rojo de arriba
   quedaría invisible en esos campos. */
.select-group:has(.input-error),
.country-state-city:has(.input-error) {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}

.error-message {
    display: block;
    width: 100%;
    flex-basis: 100%; /* fuerza línea propia dentro de los grupos flex */
    color: #e74c3c;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
    text-align: left;
}

.select-group .error-message,
.country-state-city .error-message {
    margin-top: 0;
    padding: 4px 15px 10px 45px;
}

/* Estilos específicos para el grupo de selección y campos combinados */
.select-group {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    gap: 0;
    align-items: center;
    border: 1px solid #dde2e8;
    border-radius: 12px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-group:focus-within {
    border-color: var(--pr-navy-mid);
    box-shadow: 0 0 0 3px rgba(22, 38, 64, 0.08);
}

.select-group i {
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--pr-red);
    font-size: 1.1rem;
    z-index: 10;
}

.select-group input,
.select-group select {
    border: none;
    padding-left: 45px;
    border-radius: 0;
    flex: 1 1 0%; /* sin esto, el width:100% heredado hace que cada input
                     "pida" el ancho completo y el navegador prefiera
                     partirlos en líneas separadas al haber flex-wrap */
    min-width: 0;
}

.select-group input:focus,
.select-group select:focus {
    box-shadow: none;
}

/* Separación para campos de nombre/apellido unidos */
.select-group input[name="first_name"] {
    border-right: 1px dotted #dde2e8;
}

.select-group input[name="email"],
.select-group input[name="address"] {
    flex-grow: 1;
}

/* Estilo para el Teléfono (Phone Code + Number) */
.phone-code {
    border: none !important;
    width: 26% !important;
    flex: 0 0 26% !important;
    padding-left: 45px !important;
    background-color: transparent;
    cursor: pointer;
}

.phone-number {
    width: 74% !important;
    flex: 0 0 74% !important;
    border: none !important;
    border-left: 1px dotted #dde2e8 !important;
    border-radius: 0 !important;
}

/* Estilo para el contenedor que agrupa los campos de país, estado y ciudad */
.country-state-city {
    position: relative;
    border: 1px solid #dde2e8;
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.country-state-city:focus-within {
    border-color: var(--pr-navy-mid);
    box-shadow: 0 0 0 3px rgba(22, 38, 64, 0.08);
}

.country-state-city i {
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--pr-red);
    font-size: 1.1rem;
    z-index: 10;
}

.country-state-city select {
    border: none;
    flex: 1;
    min-width: 0; /* Evita que el select se desborde */
}

.country-state-city select:not(:last-child) {
    border-right: 1px dotted #dde2e8;
}

.country-state-city select[name="country"] {
    padding-left: 45px;
}

/* Checkbox y Términos */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
    justify-content: center;
    font-size: 0.9rem;
    color: #64748b;
}

.checkbox-group label a {
    color: var(--pr-red);
    font-weight: 600;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--pr-red);
}

/* Botón Principal */
.btn-primary {
    display: flex;
    margin-top: 6px;
    background: var(--pr-red);
    color: #fff;
    font-weight: 800;
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(182, 30, 37, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.02em;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.btn-primary.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-primary:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
    color: #666 !important;    
}

.btn-primary.loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--pr-red-dark);
    color: #fff;
    transform: translateY(-2px);
}

/* Mensajes de feedback */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    display: none; /* Se activa con JS */
    font-size: 1rem;
    text-align: center;
    border: 1px solid transparent;
}

.message.success {
    display: block;
    background-color: #e7f7ed;
    color: #1a7a3d;
    border: 1px solid #bfe8cc;
}
.message.info {
    display: block;
    background-color: #eaf2fb;
    color: #2c6bb3;
    border: 1px solid #c7ddf3;
}

.message.error {
    display: block;
    background-color: #fbe9ea;
    color: #b3261e;
    border: 1px solid #f3c6c8;
}

/* Password Strength & Rules */
.strength-indicator {
    background-color: #eee;
    height: 8px;
    margin-top: 5px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.strength-indicator::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

.strength-indicator.weak::after { width: 33%; background-color: #e74c3c; }
.strength-indicator.medium::after { width: 66%; background-color: #f39c12; }
.strength-indicator.strong::after { width: 100%; background-color: #2ecc71; }

.message-small {
    font-size: 0.8em;
    margin-top: 5px;
}

#passwordRules ul {
    list-style-type: none;
    text-align: left;
    padding-left: 0;
}

/* Agente y Password Toggle */
.agent-group, .password-group {
    position: relative;
    width: 100%;
}

.agent-group i, .password-group .toggle-password {
    position: absolute;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
}

.agent-group i { left: 15px; color: var(--pr-red); font-size: 1.1rem; }
.password-group .toggle-password { right: 15px; cursor: pointer; color: var(--pr-red); font-size: 1.1rem; }

.agent-group select {
    padding-left: 45px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%23888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

/* Utilidades */
.hidden-field {
    display: none !important;
}

.honey-pot-field {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

.back-link {
    display: block;
    margin-top: 22px;
    color: var(--pr-navy);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
}

.back-link:hover {
    color: var(--pr-red);
    text-decoration: underline;
}

/* Password Requirements Box */
.password-requirements-box {
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 15px;
    margin-top: 5px;
    margin-bottom: 15px;
    text-align: left;
    transition: all 0.3s ease;
}

.strength-meter-label {
    font-size: 0.85rem;
    color: var(--pr-navy);
    margin-bottom: 5px;
    font-weight: bold;
}

.strength-meter {
    background-color: #eee;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

#strength-bar {
    height: 100%;
    width: 0%;
    background-color: #e74c3c;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.rules-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.rules-list li {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.rules-list li i {
    font-size: 0.7rem;
}

/* Estilo para los inputs de contraseña */
.password-group input {
    padding-right: 45px !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Efecto de foco en el grupo cuando las reglas aparecen */
.password-group:focus-within + .password-requirements-box {
    border-color: rgba(182, 30, 37, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#verify_code{
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 8px;
    color: var(--pr-navy);
    font-family: monospace;
    background-color: #eaf2fb;
    border: 2px dashed #c7ddf3;
    border-radius: 12px;
}

#btn-complete-reg{
    background: var(--pr-navy-mid);
    color: #fff; font-size: 1.1rem;
    font-weight: bold;
    padding: 10px 22px;
    border: none; border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(22, 38, 64, 0.25);
    transition: background 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.03em;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-top: 8px;
}
#btn-complete-reg:hover{
    background: var(--pr-navy);
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- Footer navy (cierre, mismo criterio que index.html) ---------- */
.pr-footer {
    background: var(--pr-navy-deep);
    text-align: center;
    padding: 20px;
}

.pr-footer p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .container {
        padding: 34px 22px;
        border-radius: 16px;
    }
    .content h1 {
        font-size: 1.7rem;
    }
    .select-group#normalUserFields,
    #normalUserFields {
        flex-direction: column;
    }
    #normalUserFields i {
        top: 15px;
        transform: none;
    }
    .select-group input[name="first_name"] {
        border-right: none;
        border-bottom: 1px dotted #dde2e8;
    }
    .country-state-city {
        flex-direction: column;
    }
    .country-state-city i {
        top: 15px;
        transform: none;
    }
    .country-state-city select:not(:last-child) {
        border-right: none;
        border-bottom: 1px dotted #dde2e8;
    }
    .country-state-city select[name="state"],
    .country-state-city select[name="city"] {
        padding-left: 45px;
    }
}