:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 24px;
    --radius-sm: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.fondo-cuadritos {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cuadro {
    position: absolute;
    font-size: 2rem;
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(2px);
    border-radius: 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    animation: flotar 8s infinite ease-in-out;
    transition: transform 0.2s;
}

.c1 { top: 5%; left: 3%; animation-duration: 6s; background: #fef3c7; }
.c2 { top: 15%; right: 5%; animation-duration: 7s; background: #dbeafe; }
.c3 { bottom: 20%; left: 8%; animation-duration: 9s; background: #dcfce7; }
.c4 { bottom: 10%; right: 10%; animation-duration: 5s; background: #ffe4e6; }
.c5 { top: 40%; left: 2%; animation-duration: 11s; background: #f1f5f9; }
.c6 { top: 60%; right: 2%; animation-duration: 6.5s; background: #fef9c3; }
.c7 { top: 80%; left: 15%; animation-duration: 8.5s; background: #e0e7ff; }
.c8 { top: 20%; left: 20%; animation-duration: 7.5s; background: #ccfbf1; }
.c9 { top: 70%; right: 20%; animation-duration: 10s; background: #fce7f3; }
.c10 { top: 45%; right: 15%; animation-duration: 5.5s; background: #fed7aa; }
.c11 { top: 30%; left: 30%; animation-duration: 12s; background: #cffafe; }
.c12 { bottom: 40%; right: 25%; animation-duration: 6.2s; background: #e9d5ff; }

@keyframes flotar {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.cuadro:hover {
    transform: scale(1.2) rotate(10deg);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 768px) {
    .cuadro { 
        font-size: 1.8rem; 
        padding: 10px; 
        border-radius: 16px;
        width: auto;
        height: auto;
    }
    .c1, .c2, .c3, .c4, .c5, .c6, .c7, .c8, .c9, .c10, .c11, .c12 {
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
    }
    .c1 { top: 5%; left: 5%; }
    .c2 { top: 10%; right: 5%; }
    .c3 { bottom: 15%; left: 5%; }
    .c4 { bottom: 10%; right: 5%; }
    .c5 { top: 25%; left: -3%; }
    .c6 { top: 30%; right: -3%; }
    .c7 { bottom: 25%; left: -3%; }
    .c8 { bottom: 30%; right: -3%; }
    .c9 { top: 50%; left: 5%; }
    .c10 { top: 55%; right: 5%; }
    .c11 { bottom: 45%; left: 8%; }
    .c12 { bottom: 50%; right: 8%; }
}

.auth-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.auth-view {
    display: none;
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.auth-view.active {
    display: block;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: transform 0.2s;
    backdrop-filter: blur(2px);
}

.auth-card:hover {
    transform: translateY(-4px);
}

.logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.logo h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.logo span {
    color: var(--primary);
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.8rem;
    font-weight: 500;
}

.input-group {
    position: relative;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
}

.input-group i:first-child {
    position: absolute;
    left: 16px;
    font-size: 1.3rem;
    color: var(--primary);
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border);
    border-radius: 60px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text);
    transition: var(--transition);
    outline: none;
    font-weight: 500;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.toggle-password {
    position: absolute;
    right: 18px;
    font-size: 1.3rem;
    color: var(--text-light);
    cursor: pointer;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
    font-weight: 500;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-options a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.form-options a:hover {
    text-decoration: underline;
}

.btn-main {
    width: 100%;
    background: var(--primary);
    border: none;
    padding: 14px;
    border-radius: 60px;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-main:active {
    transform: scale(0.98);
}

.btn-main:hover {
    background: var(--primary-dark);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-size: 0.75rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    margin: 0 12px;
    font-weight: 600;
}

.social-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 1rem 0;
}

.btn-social {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 60px;
    padding: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text);
    font-size: 0.95rem;
}

.btn-social:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-social:active {
    transform: translateY(0);
}

.register-link {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.85rem;
}

.register-link a {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid;
    pointer-events: auto;
    animation: slideInRight 0.3s ease forwards;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast.info {
    border-color: var(--primary);
}

.toast i {
    font-size: 1.2rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(120%);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
        align-items: center;
        justify-content: center;
    }
    
    .auth-wrapper {
        width: 100%;
        max-width: 90%;
        margin: 0 auto;
    }
    
    .auth-card {
        padding: 2rem;
        width: 100%;
        min-width: 0;
    }
    
    .logo h2 {
        font-size: 1.9rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.8rem;
    }
    
    .input-group input {
        padding: 14px 16px 14px 48px;
        font-size: 1rem;
    }
    
    .btn-main {
        padding: 14px;
        font-size: 1rem;
    }
    
    .btn-social {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .toast-container {
        bottom: 20px;
        right: 20px;
    }
    
    .toast {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .auth-wrapper {
        max-width: 100%;
        width: 100%;
    }
    
    .auth-card {
        padding: 1.8rem 1.5rem;
        border-radius: 28px;
    }
    
    .logo h2 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.6rem;
    }
    
    .input-group {
        margin-bottom: 1.1rem;
    }
    
    .input-group input {
        padding: 12px 14px 12px 45px;
        font-size: 0.95rem;
    }
    
    .input-group i:first-child {
        font-size: 1.2rem;
        left: 15px;
    }
    
    .toggle-password {
        right: 15px;
        font-size: 1.2rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 1.4rem;
    }
    
    .btn-main {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .btn-social {
        padding: 11px;
        font-size: 0.9rem;
    }
    
    .register-link {
        font-size: 0.85rem;
        margin-top: 1.1rem;
    }
    
    .divider {
        margin: 1.3rem 0;
    }
    
    .toast {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}