/* =========================================
   AYUROM CONNECT - GLASS LUXURY UI (FINAL v2)
   Correcciones: Layout Flexbox, Fix Autofill, Padding Inputs
   ========================================= */

/* --- 1. CONTENEDOR PRINCIPAL (ESTRUCTURA VERTICAL) --- */
.ayr-auth-wrap {
    display: flex;
    flex-direction: column;         /* Apilar elementos verticalmente */
    justify-content: space-between; /* Header arriba, Footer abajo */
    align-items: center;            /* Centrar horizontalmente */
    min-height: 100vh;              /* Ocupar toda la altura de la pantalla */
    width: 100%;
    position: relative;
    background-color: #f4f4f7;
    background: radial-gradient(circle at top left, #ffffff, #f0f0f4);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden; /* Evitar scroll lateral */
}

/* Orbes Decorativos (Fondo) */
.ayr-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}
.orb-1 {
    top: -10%; left: -10%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.4) 0%, rgba(197, 160, 89, 0) 70%);
}
.orb-2 {
    bottom: -10%; right: -10%; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(29, 29, 31, 0.1) 0%, rgba(29, 29, 31, 0) 70%);
}

/* --- 2. HEADER Y FOOTER (POSICIÓN FLUIDA) --- */
.ayr-auth-header {
    width: 100%;
    display: flex;
    justify-content: flex-start; /* A la izquierda */
    z-index: 10;
    margin-bottom: 20px;
    padding-left: 20px;
}

.ayr-auth-footer {
    width: 100%;
    text-align: center;
    z-index: 10;
    margin-top: 30px;
    padding-bottom: 10px;
}

/* Estilo Botón Volver */
.ayr-back-link {
    text-decoration: none;
    color: #1d1d1f;
    font-weight: 700;
    font-size: 13px;
    display: flex; align-items: center; gap: 6px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    transition: all 0.3s ease;
}
.ayr-back-link:hover { background: #fff; color: #C5A059; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.ayr-back-link .dashicons { font-size: 16px; line-height: 16px; width: 16px; height: 16px; }

/* Links del Footer */
.ayr-legal-links { margin-bottom: 8px; }
.ayr-legal-links a { color: #666; text-decoration: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.ayr-legal-links a:hover { color: #C5A059; text-decoration: underline; }
.ayr-legal-links .sep { margin: 0 8px; color: #ccc; font-size: 10px; }
.ayr-auth-footer p { margin: 0; font-size: 10px; color: #999; }

/* --- 3. TARJETA (CENTRADO AUTOMÁTICO) --- */
.ayr-auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 50px 40px;
    width: 100%;
    max-width: 400px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    border: 1px solid rgba(255, 255, 255, 1);
    position: relative;
    z-index: 1;
    margin: auto; /* MAGIA: Esto centra la tarjeta verticalmente entre header y footer */
}
.ayr-auth-card.wide { max-width: 500px; }

/* --- 4. ELEMENTOS DEL FORMULARIO --- */
.auth-header { text-align: center; margin-bottom: 35px; }
.auth-header h2 { margin: 0; color: #1d1d1f; font-weight: 800; font-size: 26px; letter-spacing: -0.5px; }
.auth-header p { color: #888; font-size: 11px; margin: 8px 0 0; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 0; }
.input-group { position: relative; margin-bottom: 20px; }

.input-group label, .form-grid label {
    display: block; font-size: 10px; font-weight: 800; color: #999;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; margin-left: 10px;
}

/* --- INPUTS & CAMPOS --- */
.input-group input, .ayr-select, .form-grid input, .phone-group input {
    width: 100%; height: 50px !important;
    border: 1px solid #e1e1e1 !important;
    border-radius: 50px !important;
    background: #ffffff !important;
    font-size: 14px; color: #1d1d1f;
    box-sizing: border-box; transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
    font-family: inherit; line-height: 50px;
    
    /* Padding Definitivo: Espacio izquierda para icono, derecha para ojo/padding normal */
    padding-left: 45px !important; 
    padding-right: 20px !important;
}

/* Fix para inputs que TIENEN el ojo de contraseña a la derecha */
.input-group input[type="password"],
.input-group.has-eye input {
    padding-right: 45px !important;
}

/* Inputs enfocados */
.input-group input:focus, .ayr-select:focus { 
    border-color: #C5A059 !important; 
    outline: none; 
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.15); 
}

/* --- FIX AUTOFILL (Evitar fondo amarillo/azul de Chrome) --- */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #1d1d1f !important;
    transition: background-color 5000s ease-in-out 0s;
    border-radius: 50px !important;
}

/* --- ICONOS --- */
/* Icono Izquierda */
.input-group i {
    position: absolute; left: 18px !important; top: 40px !important;
    color: #C5A059 !important; font-size: 18px !important; pointer-events: none; z-index: 10;
}
/* Ajuste específico para login (a veces el label mueve el icono) */
#ayr-login-form .input-group i { top: 42px !important; }

/* Icono Derecha (Ojo Password) */
.ayr-toggle-pass {
    position: absolute; 
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 15px !important;
    margin-top: 2px !important; /* Ajuste fino vertical */
    cursor: pointer; 
    color: #aaa; 
    z-index: 100;
    display: flex; align-items: center;
}
.ayr-toggle-pass:hover { color: #C5A059; }

/* Selector País */
.ayr-select {
    padding-left: 15px !important; padding-right: 30px !important;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 15px center; background-size: 12px;
    cursor: pointer; text-overflow: ellipsis;
}

/* Botón Principal */
.btn-auth {
    width: 100%; background: #1d1d1f !important; color: #ffffff !important;
    padding: 16px !important; border: none; border-radius: 50px !important;
    font-weight: 800 !important; font-size: 13px !important;
    cursor: pointer; transition: all 0.3s; margin-top: 25px;
    text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.btn-auth:hover { background: #C5A059 !important; transform: translateY(-2px); box-shadow: 0 15px 30px rgba(197, 160, 89, 0.3); }

/* --- 5. GOOGLE & EXTRAS --- */
.google-btn-wrap {
    margin-top: 25px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 25px;
    width: 100%;
    display: flex;             /* Flexbox activado */
    justify-content: center;   /* Centro horizontal */
    align-items: center;       /* Centro vertical */
}

/* Forzar centrado del iframe de Google */
.g_id_signin, .g_id_signin iframe, .g_id_signin > div {
    margin: 0 auto !important;
    display: block !important;
    border-radius: 50px !important;
}

.auth-links { text-align: center; margin-top: 25px; display: flex; flex-direction: column; gap: 12px; font-size: 12px; }
.auth-links a { color: #666; text-decoration: none; font-weight: 500; }
.auth-links a:hover { color: #C5A059; }

.terms-check { font-size: 11px; color: #666; margin: 15px 0; display: flex; align-items: center; gap: 8px; }
.terms-check input { accent-color: #C5A059; }
.terms-check a { color: #C5A059; font-weight: 700; text-decoration: none; }

.captcha-notice { font-size: 9px; color: #bbb; text-align: center; margin-top: -10px; margin-bottom: 10px; }

/* Alertas */
.ayr-alert { padding: 12px; border-radius: 50px; font-size: 12px; text-align: center; margin-bottom: 20px; font-weight: 600; }
.ayr-alert.success { background: rgba(39, 174, 96, 0.1); color: #27ae60; border: 1px solid rgba(39, 174, 96, 0.2); }
.ayr-alert.error { background: rgba(231, 76, 60, 0.1); color: #c0392b; border: 1px solid rgba(231, 76, 60, 0.2); }
.ayr-alert.info { background: rgba(52, 152, 219, 0.1); color: #2980b9; border: 1px solid rgba(52, 152, 219, 0.2); }

/* --- 6. RESPONSIVE (MÓVIL) --- */
@media (max-width: 600px) {
    .ayr-auth-wrap { padding: 10px; }
    .ayr-auth-card { padding: 40px 25px; margin: 20px auto; } /* Margen para separar de header/footer en móvil */
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .input-group, .form-grid .input-group { margin-bottom: 15px; }
    .ayr-auth-header { justify-content: center; padding-left: 0; } /* Centrar botón volver en móvil */
}