/* ========================================
   CalcPRO - Authentication Styles
   Estilos para Login y Registro
   ======================================== */

/* ========================================
   Auth Page Layout
   ======================================== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a1628 0%, #1a365d 50%, #0d4a6b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
}

/* Background Animation */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(64, 224, 208, 0.15), rgba(30, 136, 229, 0.1));
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: 30%;
    animation-delay: -10s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    top: 20%;
    left: 50%;
    animation-delay: -15s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-30px) rotate(5deg);
    }

    50% {
        transform: translateY(0) rotate(0deg);
    }

    75% {
        transform: translateY(30px) rotate(-5deg);
    }
}

/* ========================================
   Auth Container
   ======================================== */
.auth-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 650px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ========================================
   Auth Branding (Left Panel)
   ======================================== */
.auth-branding {
    flex: 1;
    background: var(--gradient-primary);
    padding: var(--space-10);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-branding::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.auth-branding-content {
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.auth-logo-icon {
    font-size: 48px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.auth-logo-text {
    font-family: var(--font-primary);
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--color-white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.auth-headline {
    font-family: var(--font-primary);
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.3;
    margin-bottom: var(--space-4);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.auth-subheadline {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: var(--space-8);
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--font-size-base);
}

.auth-feature-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Stats for Register Page */
.auth-stats {
    display: flex;
    gap: var(--space-6);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-stat {
    text-align: center;
}

.auth-stat-number {
    display: block;
    font-family: var(--font-primary);
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-white);
}

.auth-stat-label {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   Auth Form (Right Panel)
   ======================================== */
.auth-form-container {
    flex: 1;
    padding: var(--space-10);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--color-white);
    overflow-y: auto;
}

.auth-form-wrapper {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.auth-form-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-form-header h2 {
    font-family: var(--font-primary);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: var(--space-2);
}

.auth-form-header p {
    color: var(--color-gray-500);
    font-size: var(--font-size-base);
}

/* ========================================
   Social Login Buttons
   ======================================== */
.social-login {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-gray-700);
    cursor: pointer;
    transition: var(--transition-base);
}

.social-btn:hover {
    border-color: var(--color-gray-300);
    background: var(--color-gray-50);
    transform: translateY(-1px);
}

.social-btn svg {
    flex-shrink: 0;
}

.social-google:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.05);
}

.social-facebook:hover {
    border-color: #1877F2;
    background: rgba(24, 119, 242, 0.05);
}

.social-apple:hover {
    border-color: #000000;
    background: rgba(0, 0, 0, 0.03);
}

/* ========================================
   Divider
   ======================================== */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-6) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-gray-200);
}

.auth-divider span {
    padding: 0 var(--space-4);
    color: var(--color-gray-400);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* ========================================
   Form Styles
   ======================================== */
.auth-form .form-group {
    margin-bottom: var(--space-4);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-4);
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}

.input-icon-wrapper .form-input {
    padding-left: 48px;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: var(--space-2);
    opacity: 0.6;
    transition: var(--transition-base);
}

.password-toggle:hover {
    opacity: 1;
}

.input-hint {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-gray-400);
    margin-top: var(--space-1);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: var(--space-2);
}

.strength-bar {
    height: 4px;
    background: var(--color-gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.strength-indicator {
    height: 100%;
    width: 0%;
    transition: var(--transition-base);
    border-radius: var(--radius-full);
}

.strength-indicator.weak {
    width: 33%;
    background: var(--color-error);
}

.strength-indicator.medium {
    width: 66%;
    background: var(--color-warning);
}

.strength-indicator.strong {
    width: 100%;
    background: var(--color-success);
}

.strength-text {
    font-size: var(--font-size-xs);
    color: var(--color-gray-500);
    margin-top: var(--space-1);
    display: block;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-gray-600);
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.terms-checkbox {
    align-items: flex-start;
}

.terms-checkbox span {
    line-height: 1.5;
}

.forgot-password {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-base);
}

.forgot-password:hover {
    color: var(--color-secondary-dark);
    text-decoration: underline;
}

/* Submit Button */
.auth-submit {
    margin-top: var(--space-4);
    position: relative;
    overflow: hidden;
}

.auth-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.auth-submit:hover::before {
    left: 100%;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-gray-100);
}

.auth-footer p {
    color: var(--color-gray-500);
    font-size: var(--font-size-sm);
}

.auth-footer a {
    color: var(--color-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-base);
}

.auth-footer a:hover {
    color: var(--color-secondary-dark);
    text-decoration: underline;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 900px) {
    .auth-container {
        flex-direction: column;
        max-width: 500px;
        min-height: auto;
    }

    .auth-branding {
        padding: var(--space-8) var(--space-6);
    }

    .auth-headline {
        font-size: var(--font-size-2xl);
    }

    .auth-features {
        display: none;
    }

    .auth-stats {
        justify-content: center;
    }

    .auth-form-container {
        padding: var(--space-8) var(--space-6);
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: var(--space-2);
    }

    .auth-container {
        border-radius: var(--radius-xl);
    }

    .auth-branding {
        padding: var(--space-6) var(--space-4);
    }

    .auth-logo-text {
        font-size: var(--font-size-2xl);
    }

    .auth-headline {
        font-size: var(--font-size-xl);
    }

    .auth-subheadline {
        font-size: var(--font-size-sm);
        display: none;
    }

    .auth-form-container {
        padding: var(--space-6) var(--space-4);
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-stats {
        gap: var(--space-4);
    }

    .auth-stat-number {
        font-size: var(--font-size-xl);
    }
}

/* ========================================
   User Menu (for logged in state)
   ======================================== */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: var(--transition-base);
    border: 2px solid transparent;
}

.user-avatar:hover {
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-base);
    z-index: var(--z-dropdown);
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-gray-100);
}

.user-dropdown-name {
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--color-gray-800);
    font-size: var(--font-size-sm);
}

.user-dropdown-email {
    font-size: var(--font-size-xs);
    color: var(--color-gray-500);
    margin-top: 2px;
}

.user-dropdown-menu {
    padding: var(--space-2);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    color: var(--color-gray-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--color-gray-50);
    color: var(--color-gray-800);
}

.user-dropdown-item.logout {
    color: var(--color-error);
}

.user-dropdown-item.logout:hover {
    background: rgba(244, 67, 54, 0.1);
}

/* Auth Buttons in Header */
.auth-buttons {
    display: flex;
    gap: var(--space-3);
}

.btn-login {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

.btn-register {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}