/* Reset y variables de color */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
    --bg-dark: #090914;
    --bg-left: #0c0b1a;
    --bg-right: #070712;
    --card-bg: #14132b;
    --border-purple: #322b5f;
    --accent-purple: #8b5cf6;
    --accent-hover: #7c3aed;
    --input-bg: #e8f0fe;
    --text-white: #ffffff;
    --text-gray: #9ca3af;
    --text-dark: #1f2937;
    --error-red: #ef4444;
}

body, html {
    height: 100%;
    width: 100%;
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
}

/* Layout Principal */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --- PANEL IZQUIERDO --- */
.panel-left {
    flex: 1;
    background-color: var(--bg-left);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 60px 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-header {
    border: 1.5px solid var(--accent-purple);
    border-radius: 12px;
    padding: 18px 30px;
    text-align: center;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    margin-bottom: 70px;
    max-width: 450px;
}

.badge-header h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-white);
    text-transform: uppercase;
}

/* Grilla de Tarjetas */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px 25px;
    width: 100%;
    max-width: 550px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.icon-box {
    width: 55px;
    height: 55px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-purple);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--accent-purple);
    transition: all 0.3s ease;
}

.feature-card:hover .icon-box {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.feature-card span {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}


/* --- PANEL DERECHO --- */
.panel-right {
    flex: 1;
    background-color: var(--bg-right);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo Circular */
.logo-container {
    margin-bottom: 25px;
}

.logo-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, #1a0b36 0%, #070712 100%);
    border: 2px solid var(--accent-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
}

.logo-circle i {
    font-size: 1.6rem;
    color: var(--accent-purple);
    margin-bottom: 2px;
}

.logo-circle span {
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Textos Titulares */
.welcome-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    width: 100%;
    text-align: left;
}

.welcome-subtitle {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 25px;
    width: 100%;
    text-align: left;
    line-height: 1.4;
}

/* Formulario */
#login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    background-color: var(--input-bg);
    color: var(--text-dark);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* Campo de Contraseña con icono */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
}

.toggle-password-btn:hover {
    color: var(--text-dark);
}

/* Botón Principal */
.btn-primary {
    margin-top: 10px;
    width: 100%;
    padding: 13px;
    background-color: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-primary:active {
    transform: scale(0.99);
}

/* Footer y enlaces */
.login-footer {
    margin-top: 25px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.login-footer a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
}

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

/* Alert Box */
.alert {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: none;
}

.alert.error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error-red);
    color: #fca5a5;
    display: block;
}

.alert.success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #6ee7b7;
    display: block;
}

.hidden {
    display: none !important;
}

/* Spinner animado de carga */
.spinner {
    width: 20px;
    height: 20px;
    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); }
}

/* Adaptación Responsiva para Celulares / Tablets */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
    }

    .panel-left {
        display: none; /* Se oculta la parte izquierda en pantallas pequeñas */
    }

    .panel-right {
        padding: 20px;
    }
}
