/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --secondary-color: #64748B;
    --success-color: #10B981;
    --error-color: #EF4444;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --bg-color: #F8FAFC;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background: #2A2A2E;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 30px;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    width: 100%;
    max-width: 400px;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 10px;
    animation: slideUp 0.5s ease-out;
}

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


.login-card {
    background: transparent;
    border-radius: 0;
    padding: 20px;
    box-shadow: none;
    position: relative;
    overflow: visible;
}
/* Login Card */
.login-card::before {
    display: none;
}

/* Logo */
.logo {
    display: flex;
    justify-content: center;
    margin-top: -10px;
    animation: bounce 1s ease-in-out;
}

.logo img {
    max-width: 200px;
    height: auto;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Typography */
h1 {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #94A3B8;
    font-size: 14px;
    margin-bottom: 32px;
}

/* Form */
#loginForm {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    position: relative;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    margin-bottom: 8px;
    margin-left: 15px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid #222222;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #1F1F1F;
    color: #FFFFFF;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(79, 70, 229, 0.1);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Icons */
.form-group .icon {
    position: absolute;
    left: 14px;
    top: 40px;
    color: var(--text-secondary);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 37px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

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

.toggle-password .hidden {
    display: none;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -8px 0 8px;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(79, 70, 229, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader svg {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.btn-loader.hidden,
.btn-text.hidden {
    display: none;
}

/* Divider */
.divider {
    margin: 28px 0;
    text-align: center;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 60px);
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    padding: 0 12px;
}

/* Social Login */
.social-login {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-social {
    flex: 1;
    padding: 12px;
    border: 2px solid #3E3E42;
    border-radius: 12px;
    background: #1F1F1F;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-social:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-social:active {
    transform: translateY(0);
}

/* Register Link */
.register-link {
    text-align: center;
    font-size: 14px;
    color: #94A3B8;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.register-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Message */
.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.hidden {
    display: none;
}

.message.success {
    background: #ECFDF5;
    color: var(--success-color);
    border: 1px solid #A7F3D0;
}

.message.error {
    background: #FEF2F2;
    color: var(--error-color);
    border: 1px solid #FECACA;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding-top: 0px;
    }

    .container {
        padding: 10px;
    }

    .login-card {
        padding: 0 20px 20px 20px;
        padding-top: 0;
    }

    .logo {
        margin-top: 0;
        margin-bottom: 0;
    }

    .logo img {
        max-width: 200px;
    }

    h1 {
        font-size: 24px;
    }

    input[type="text"],
    input[type="password"] {
        font-size: 16px; /* Previene zoom en iOS */
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .forgot-password {
        align-self: flex-start;
    }
}

/* Landscape móvil */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding-top: 5px;
    }

    .login-card {
        padding: 0 20px 20px 20px;
    }

    .logo {
        margin-bottom: 8px;
    }

    .logo img {
        max-width: 70px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    input[type="text"],
    input[type="password"] {
        padding: 10px 12px 10px 40px;
    }

    .form-group .icon {
        left: 12px;
        top: 35px;
    }

    .subtitle {
        font-size: 12px;
        margin-bottom: 12px;
    }

    #loginForm {
        gap: 8px;
    }

    .btn-login {
        padding: 10px;
    }

    .divider {
        margin: 12px 0;
    }

    .social-login {
        margin-bottom: 8px;
    }

    .btn-social {
        padding: 8px;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .container {
        max-width: 450px;
    }

    .login-card {
        padding: 48px 40px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para navegación por teclado */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F1F5F9;
        --text-secondary: #94A3B8;
        --bg-color: #0F172A;
        --border-color: #334155;
        --white: #1E293B;
    }

    body {
        background: #2A2A2E;
    }

    input[type="text"],
    input[type="password"] {
        background: #1F1F1F;
        color: var(--text-primary);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .btn-social {
        background: #1F1F1F;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

/* Welcome Page Styles */
.welcome-container {
    width: 100%;
    max-width: 500px;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.welcome-content {
    text-align: center;
}

.welcome-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    animation: floatAnimation 3s ease-in-out infinite;
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.welcome-logo img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(79, 70, 229, 0.3));
}

.welcome-title {
    font-size: 38px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.welcome-subtitle {
    font-size: 16px;
    color: #94A3B8;
    margin-bottom: 48px;
    line-height: 1.6;
}

.btn-access {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 48px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px -2px rgba(79, 70, 229, 0.4);
    margin-bottom: 48px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.btn-access:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -4px rgba(79, 70, 229, 0.5);
}

.btn-access:active {
    transform: translateY(-1px);
}

.btn-access:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-access svg {
    transition: transform 0.3s ease;
}

.btn-access:hover:not(:disabled) svg {
    transform: translateX(5px);
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
}

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

.feature svg {
    animation: pulse 2s ease-in-out infinite;
}

.feature:nth-child(1) svg {
    animation-delay: 0s;
}

.feature:nth-child(2) svg {
    animation-delay: 0.3s;
}

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

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.feature span {
    font-size: 14px;
    color: #94A3B8;
    font-weight: 500;
}

/* Welcome Page Responsive */
@media (max-width: 480px) {
    .welcome-logo img {
        max-width: 150px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 36px;
    }

    .btn-access {
        padding: 14px 36px;
        font-size: 16px;
    }

    .welcome-features {
        gap: 24px;
    }

    .feature span {
        font-size: 13px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .welcome-logo img {
        max-width: 120px;
    }

    .welcome-title {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .welcome-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    .btn-access {
        padding: 12px 32px;
        font-size: 15px;
        margin-bottom: 24px;
    }

    .welcome-features {
        gap: 20px;
    }

    .feature svg {
        width: 20px;
        height: 20px;
    }
}

/* Botón de cerrar sesión */
.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: #94A3B8;
    border: 2px solid #3E3E42;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
    font-family: 'Poppins', sans-serif;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
    transform: translateY(-2px);
}

.btn-logout:active {
    transform: translateY(0);
}

.btn-logout svg {
    width: 16px;
    height: 16px;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease-in-out;
    z-index: 9999;
    max-width: 400px;
    font-family: 'Poppins', sans-serif;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #10B981;
    color: white;
}

.notification.error {
    background: #EF4444;
    color: white;
}

.notification.info {
    background: var(--primary-color);
    color: white;
}

.notification.warning {
    background: #F59E0B;
    color: white;
}

@media (max-width: 480px) {
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}
