/* --- General Styles & Variables --- */
:root {
    --primary-color: #005A9C;
    --primary-dark-color: #003B64;
    --accent-glow: rgba(0, 90, 156, 0.4);
    --text-color-light: #f0f8ff;
    --text-color-dark: #333;
    --card-bg-color: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
    --error-color: #ffcccc;
    --shadow: 0 8px 32px 0 rgba(0, 20, 40, 0.37);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color-light);
    background: linear-gradient(135deg, #001e3c, #004a7c, #002855, #003d6b);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
}

/* Animated gradient background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating particles effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200% 200%;
    animation: particleFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(10px, -10px);
    }

    50% {
        transform: translate(-5px, 5px);
    }

    75% {
        transform: translate(5px, 10px);
    }
}

/* --- Header & Notification --- */
.notification-bar {
    background-color: rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

/* ===== CORRECCIÓN DE CENTRADO DEL LOGO ===== */
.main-header {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem 2rem;
    display: grid;
    /* Cambiado a Grid para un centrado perfecto */
    grid-template-columns: 1fr auto 1fr;
    /* Tres columnas: izquierda, centro (auto), derecha */
    align-items: center;
}

.logo {
    height: 45px;
    max-width: 150px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo.logo-colored {
    filter: none;
}

/* Posiciona cada logo en su columna */
.logo:nth-child(1) {
    justify-self: start;
}

.logo:nth-child(2) {
    justify-self: center;
}

.logo:nth-child(3) {
    justify-self: end;
}


/* --- Main Content --- */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.title-container {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInDown 0.8s ease forwards;
    position: relative;
    z-index: 1;
}

.title-container h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 0 0 40px rgba(0, 90, 156, 0.2);
    background: linear-gradient(135deg, #ffffff, #a8d8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-container p {
    font-size: 1.2rem;
    color: rgba(240, 248, 255, 0.9);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Profile Cards --- */
.profiles-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.card {
    background: var(--card-bg-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    width: 320px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 360px;
    box-sizing: border-box;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    z-index: 1;
}

/* Stagger animation for cards */
.card:nth-child(1) {
    animation-delay: 0.2s;
}

.card:nth-child(2) {
    animation-delay: 0.4s;
}

.card:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 60px 0 rgba(0, 90, 156, 0.4), 0 0 40px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.card:hover::before {
    opacity: 1;
}

.card-content {
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-icon {
    font-size: 3.5rem;
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px var(--accent-glow);
    transition: all 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    text-shadow: 0 0 30px var(--accent-glow), 0 0 50px rgba(0, 90, 156, 0.3);
}

.card h2 {
    margin: 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.card p {
    font-size: 1rem;
    color: rgba(240, 248, 255, 0.8);
    margin-bottom: 2rem;
}

.btn {
    background: transparent;
    color: var(--text-color-light);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    border: 2px solid var(--text-color-light);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--text-color-light);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    color: var(--primary-dark-color);
    box-shadow: 0 0 30px rgba(240, 248, 255, 0.6), 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* --- STYLES for REDESIGNED Login Form --- */
.modern-login-form {
    opacity: 0;
    animation: fadeIn 0.5s 0.1s ease forwards;
    text-align: left;
    color: var(--text-color-light);
}

.modern-login-form h3 {
    text-align: center;
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(240, 248, 255, 0.6);
    transition: all 0.3s ease;
}

.input-group .toggle-password {
    left: auto;
    right: 15px;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 10;
}

.input-group .toggle-password:hover {
    color: var(--text-color-light);
    transform: translateY(-50%) scale(1.15);
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-color-light);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group input::placeholder {
    color: rgba(240, 248, 255, 0.5);
}

.input-group input:focus {
    outline: none;
    border-color: var(--text-color-light);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(0, 90, 156, 0.2);
    transform: translateY(-2px);
}

.input-group input:focus+i,
.input-group input:not(:placeholder-shown)+i {
    color: var(--text-color-light);
    transform: translateY(-50%) scale(1.1);
}

.modern-login-form .btn {
    width: 100%;
    margin-top: 1rem;
    background: var(--text-color-light);
    color: var(--primary-dark-color);
    font-weight: 700;
}

.back-arrow {
    position: absolute;
    top: 25px;
    left: 25px;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    z-index: 10;
}

.back-arrow:hover {
    color: #fff;
    transform: scale(1.2);
}

.error-message {
    color: var(--error-color);
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-top 0.3s ease-out;
}

.error-message.show {
    max-height: 50px;
    opacity: 1;
    margin-top: 1rem;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Footer --- */
.main-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    color: rgba(240, 248, 255, 0.6);
}

.main-footer p {
    margin: 0;
    font-style: italic;
}

.creator-credit {
    font-style: normal;
    font-size: 0.9rem;
    margin-top: 1rem !important;
    color: rgba(240, 248, 255, 0.5);
    letter-spacing: 0.5px;
}

.creator-name {
    font-weight: 600;
    color: rgba(240, 248, 255, 0.8);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .main-header {
        grid-template-columns: auto 1fr auto;
        /* Ajuste para móvil */
        gap: 10px;
        padding: 1rem;
    }

    .title-container h1 {
        font-size: 2.2rem;
    }

    .card {
        width: 80%;
        margin: 0 auto;
        min-height: auto;
    }
}