/* Brand Colors de Propiedades.app */
:root {
    --keppel-50: #ecfdf5;      /* Verde muy claro para hover */
    --keppel-400: #26C6B2;     /* Verde claro botones secundarios */
    --keppel-500: #04C8B9;     /* Verde principal */
    --keppel-600: #00A599;     /* Verde oscuro hover */
    --keppel-700: #008e7d;     /* Verde más oscuro */

    --east-bay-800: #183C58;   /* Azul oscuro boton principal */
    --east-bay-700: #363A7A;   /* Azul medio */

    --concrete-200: #e5e7eb;   /* Gris claro bordes */
    --concrete-300: #d1d5db;   /* Gris medio inputs */
    --concrete-600: #6b7280;   /* Gris texto */
    --concrete-800: #374151;   /* Gris oscuro */
}

/* Reset global para prevenir scroll horizontal */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Scrollbar global con color Keppel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--keppel-500);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--keppel-600);
}

/* Para Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--keppel-500) #f1f1f1;
}

/* Scrollbar global con color Keppel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--keppel-500);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--keppel-600);
}

/* Para Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--keppel-500) #f1f1f1;
}

/* Contenedor principal - Mobile First */
.auth-container {
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: white;
    padding: 1rem;
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
}

/* Degradado radial con blur (::before) */
.auth-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(50, 255, 229, 0.3) 0%, rgb(255, 255, 255) 35%) right 100px top 100px;
    backdrop-filter: blur(90px);
    filter: blur(90px);
    -webkit-filter: blur(90px);
    z-index: 0;
}

/* Contenedor de iconos inmobiliarios */
.real-estate-icons-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Contenedor del formulario - Responsive Mobile-First */
.form-container {
    width: 100%;
    max-width: 22rem; /* Consistente con desktop: 22rem (352px) para formulario más estrecho */
    position: relative;
    z-index: 10;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2.5rem; /* Espacio para el selector de idioma */
}

/* Card del formulario centrado */
.form-card {
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--concrete-200);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    animation: slideInFromRight 0.8s ease-out 0.3s forwards;
    width: 100%;
    max-width: 100%;
    text-align: center;
}

/* Animación slideInFromRight para formulario */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(120px) scale(0.9);
        filter: blur(5px);
    }
    50% {
        opacity: 0.7;
        transform: translateX(20px) scale(0.98);
        filter: blur(1px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0px);
    }
}

/* Animación del logo */
.logo-container {
    animation: fadeInScale 0.6s ease-out 0.1s forwards;
    opacity: 0;
    text-align: center;
    margin-bottom: 1.5rem;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logo-img {
    height: 3rem;
    width: auto;
    max-width: 150px;
}

.logo-img-normal {
    height: auto;
    width: auto;
    max-height: 5rem; /* Aumentado de 4rem para que se vea más grande */
    max-width: 250px; /* Aumentado de 200px */
    display: block;
    margin: 0 auto;
}

/* Animación del título */
.title-container {
    animation: slideInUp 0.6s ease-out 0.2s forwards;
    opacity: 0;
    text-align: center;
    margin-bottom: 1.75rem; /* Reducido de 2rem */
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forzar tamaño pequeño del título con máxima especificidad */
.title-container h1,
.title-container h1[data-translate="login_title"],
h1[data-translate="login_title"] {
    font-size: 1.25rem !important; /* Forzado con !important */
    font-weight: 500 !important;
    color: var(--east-bay-800) !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.2 !important;
}

.title-container p {
    color: var(--concrete-600);
    font-size: 0.875rem;
    margin-top: 0; /* Asegurar que esté pegado al título */
}

/* Estilos del formulario centrado */
.welcome-form, .auth-form {
    width: 100%;
    text-align: left;
}

/* Asegurar que todos los formularios tengan el estilo correcto */
.auth-form .form-group,
.welcome-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form .form-label,
.welcome-form .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--concrete-700);
    margin-bottom: 0.5rem;
    text-align: left;
}

.auth-form .form-input,
.welcome-form .form-input {
    width: 100%;
    border: 1px solid var(--concrete-300);
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.auth-form .form-input:focus,
.welcome-form .form-input:focus {
    outline: none;
    border-color: var(--keppel-400);
    box-shadow: 0 0 0 3px rgba(38, 198, 178, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--concrete-700);
    margin-bottom: 0.5rem;
    text-align: left; /* Alineado a la izquierda como en la referencia */
}

/* Campos de entrada con focus en Keppel */
.form-input {
    width: 100%;
    border: 1px solid var(--concrete-300);
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--keppel-400);
    box-shadow: 0 0 0 3px rgba(38, 198, 178, 0.1);
}

/* Botones con colores exactos */
.btn-primary {
    background: linear-gradient(135deg, var(--keppel-500), var(--keppel-600));
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(38, 198, 178, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(38, 198, 178, 0.4);
}

.btn-secondary {
    background-color: var(--keppel-400);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.15s ease-in-out;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
}

.btn-secondary:hover {
    opacity: 0.9;
    color: white;
    text-decoration: none;
}

/* Título de invitación más pequeño */
.auth-title {
    font-size: 1.25rem !important; /* 20px en lugar de tamaño grande */
    font-weight: 600 !important;
    color: var(--east-bay-800) !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.3 !important;
    text-align: center;
}

/* Descripción de autenticación concisa */
.auth-description {
    color: var(--concrete-600);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Footer */
.auth-footer {
    position: relative;
    z-index: 10;
    margin-top: 2rem;
    text-align: center;
    color: var(--concrete-600);
    font-size: 0.75rem;
}

.auth-footer a {
    color: var(--keppel-500);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Navegación superior */
.top-nav {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: var(--concrete-600);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
}

.nav-link:hover {
    color: var(--east-bay-800);
    border-color: var(--concrete-200);
    text-decoration: none;
}

.nav-link-primary {
    background-color: var(--east-bay-800);
    color: white;
    border-color: var(--east-bay-800);
}

.nav-link-primary:hover {
    opacity: 0.9;
    color: white;
}

/* Responsive Mobile-First */
@media (max-width: 640px) {
    .auth-container {
        padding: 0.5rem;
        justify-content: center;
        padding-top: 2rem;
    }

    .auth-container::before {
        background: radial-gradient(circle, rgba(50, 255, 229, 0.2) 0%, rgb(255, 255, 255) 40%) center top 50px;
        filter: blur(60px);
        -webkit-filter: blur(60px);
    }

    .form-container {
        transform: none;
        max-width: 22rem; /* Consistente con desktop: 22rem (352px) para formulario más estrecho */
    }

    .form-card {
        margin: 0 0.5rem;
    }

        /* Mantener mismo tamaño en móvil: 1.25rem */
        .title-container h1,
        .title-container h1[data-translate="login_title"],
        h1[data-translate="login_title"] {
            font-size: 1.25rem !important; /* Mismo tamaño que desktop */
        }

    .language-selector-top {
        top: 0.75rem; /* Esquina superior móvil */
        right: 0.5rem; /* Más cerca del borde para evitar desbordamiento */
        gap: 0.375rem; /* Espacio reducido en móvil */
        max-width: calc(100vw - 1rem); /* Prevenir desbordamiento en móvil */
    }

    .language-selector-title {
        font-size: 0.625rem; /* Texto más pequeño en móvil */
        padding: 0.2rem 0.375rem; /* Padding más compacto */
    }

    .language-flags .flag-btn {
        padding: 0.2rem; /* Padding más compacto en móvil */
    }

    .top-nav {
        top: 0.5rem;
        right: 0.5rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Tablet y superior */
@media (min-width: 641px) {
    .form-container {
        /* Mantenemos centrado en vez de offset */
        transform: none;
    }

    .form-card {
        padding: 2rem;
    }

    .title-container h1 {
        font-size: 1.25rem !important; /* Mantener consistencia con mobile */
    }
}

@media (min-width: 1024px) {
    .form-container {
        /* En pantallas grandes seguimos centrado */
        transform: none;
    }
}

/* Estilos para iconos flotantes */
.icon-float {
    position: absolute;
    color: rgba(4, 200, 185, 0.4); /* Keppel con transparencia */
    pointer-events: none;
    animation-fill-mode: forwards;
    opacity: 0;
}

.estate-icon-mdi {
    font-size: 55px;
    opacity: 0.8; /* Aumentar opacidad de iconos */
}

/* Responsive para iconos en móvil */
@media (max-width: 640px) {
    .estate-icon-mdi {
        font-size: 45px;
    }
}

/* Botones lado a lado - Tamaño reducido */
.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.submit-button-half {
    flex: 1;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 0.625rem 0.875rem; /* Reducido de 0.875rem 1rem */
    border-radius: 0.375rem; /* Reducido de 0.5rem */
    font-weight: 600;
    font-size: 0.875rem; /* Reducido de 1rem */
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button-half:hover {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.register-button-half {
    flex: 1;
    background: var(--keppel-500); /* Keppel sólido sin gradiente */
    color: white;
    padding: 0.625rem 0.875rem; /* Reducido de 0.875rem 1rem */
    border-radius: 0.375rem; /* Reducido de 0.5rem */
    font-weight: 600;
    font-size: 0.875rem; /* Reducido de 1rem */
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.register-button-half:hover {
    background: var(--keppel-600); /* Keppel sólido hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(4, 200, 185, 0.25);
}

/* Selector de idioma - Sin contenedor, directo sobre la página */
.language-selector-top {
    position: fixed; /* Fijo en la página */
    top: 1rem; /* Parte superior */
    right: 1rem; /* Reducido para evitar desbordamiento */
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Espacio reducido */
    z-index: 1000; /* Z-index alto */
    max-width: calc(100vw - 2rem); /* Prevenir desbordamiento */
    /* Sin fondo, sin padding, sin borders - directo sobre la página */
}

.language-selector-title {
    font-size: 0.75rem; /* Más pequeño */
    font-weight: 400; /* Menos bold */
    color: var(--concrete-600);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.9); /* Solo el texto tiene fondo */
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-flags {
    display: flex;
    align-items: center;
    gap: 0.25rem; /* Más compacto */
}

.language-flags .flag-btn {
    background: rgba(255, 255, 255, 0.9); /* Fondo individual */
    padding: 0.25rem;
    border-radius: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flag-btn {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    padding: 0;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-btn:hover {
    opacity: 1;
}

.flag-btn.active {
    opacity: 1;
}

.flag-btn svg {
    width: 1.5rem;
    height: 1rem;
    border-radius: 0.125rem;
}

/* Checkbox estilizado con bordes más redondos y finos */
.form-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 1px solid var(--concrete-300); /* Borde más fino: 1px en lugar de 2px */
    border-radius: 0.375rem; /* Bordes redondos pero no 100% */
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.form-checkbox:hover {
    border-color: var(--keppel-400);
}

.form-checkbox:checked {
    background: var(--keppel-500);
    border-color: var(--keppel-500);
}

.form-checkbox:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.form-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(4, 200, 185, 0.1);
}

/* Etiqueta del checkbox */
.checkbox-label {
    font-size: 0.875rem;
    color: var(--concrete-600);
    margin: 0;
    cursor: pointer;
    user-select: none;
}

/* =======================
   ESTILOS REGISTRO - INPUTS CON PREFIJO
   ======================= */

/* Input con prefijo para teléfono y licencia */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.input-prefix {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--concrete-500);
    font-weight: 500;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}

.form-input.with-prefix, .auth-form .form-input.with-prefix, .welcome-form .form-input.with-prefix {
    padding-left: 3.5rem !important; /* Espacio reducido para el prefijo integrado */
    padding-right: 0.75rem !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Select personalizado */
.form-select, .auth-form .form-select, .welcome-form .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Texto de ayuda para campos */
.form-help {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--concrete-500);
    font-style: italic;
}

/* Enlaces de navegación en formularios de auth */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link-text {
    font-size: 0.875rem;
    color: var(--concrete-600);
    margin-bottom: 0.5rem;
    display: block;
}

.auth-link {
    color: var(--keppel-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--keppel-700);
    text-decoration: underline;
}

/* Grupo de checkbox estilizado */
.checkbox-group {
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem; /* Aún más cerca del checkbox */
    cursor: pointer;
    line-height: 1.5;
}

.checkmark {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
}

.checkbox-text {
    font-size: 0.875rem;
    color: var(--concrete-600);
}

.terms-link {
    color: var(--keppel-600);
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    color: var(--keppel-700);
    text-decoration: underline;
}

/* Botón completo para registro */
.btn-full {
    width: 100%;
    margin-top: 1.5rem;
}

/* Loading spinner */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.loading-spinner i {
    animation: spin 1s linear infinite;
}

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

/* Campos de contraseña */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--concrete-500);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--keppel-500);
}

/* Indicador de fortaleza de contraseña */
.password-strength {
    margin-top: 0.5rem;
    display: none;
}

/* Errores de input */
.input-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

/* ==========================================
   SCROLLBAR GLOBAL - COLOR KEPPEL
   ========================================== */

/* Scrollbar global con color Keppel sólido */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--keppel-500) !important;
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--keppel-600) !important;
}

/* Para Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--keppel-500) #f1f1f1;
}
