/* Variables CSS para consistencia con el diseño institucional */
:root {
    --primary-blue: #01579B;
    --secondary-blue: #0f62ac;
    --light-blue: #e3f2fd;
    --accent-blue: #0383c7;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
	margin: 0;
	padding: 0;
	border: none;
	outline: none;
	box-sizing: border-box;
}

body {
	overflow: hidden;
	width: 100%;
	height: 100vh;
	margin: 0;
	padding: 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 50%, var(--accent-blue) 100%);
	background-attachment: fixed;
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
}

/* Patrón sutil de fondo */
body::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-image: 
		radial-gradient(circle at 25px 25px, rgba(255,255,255,0.1) 2px, transparent 2px),
		radial-gradient(circle at 75px 75px, rgba(255,255,255,0.05) 2px, transparent 2px);
	background-size: 100px 100px;
	pointer-events: none;
}
#wrapper {
	width: 420px;
	max-width: 90vw;
	z-index: 10;
	position: relative;
}

#login-title {
	display: flex;
	justify-content: center;
    font-size: 1.2rem;
}

.logo-header {
	display: flex;
	justify-content: center;
	margin-bottom: 0.5rem;
	opacity: 0;
	animation: fadeInDown 0.8s ease-out 0.2s forwards;
}

.logo-header img {
	filter: drop-shadow(var(--shadow-lg)) brightness(1.1);
	transition: transform 0.3s ease;
}

.logo-header img:hover {
	transform: scale(1.05);
}

.login-form {
	margin: 0 auto;
	position: relative;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	box-shadow: var(--shadow-xl);
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px);
	animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.login-form::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
}

.login-form .header {
    display: flex;
    justify-content: center;
    padding: 1rem 0 0 0;
}

.login-form .header img {
    filter: drop-shadow(var(--shadow-sm));
    transition: transform 0.3s ease;
}

.login-form .header img:hover {
    transform: scale(1.05);
}

.login-form .header h1 {
	font-weight: 600;
	font-size: 1.75rem;
	line-height: 1.2;
	color: var(--primary-blue);
	margin-bottom: 0.5rem;
	text-align: center;
}

.login-form .header span {
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--gray-600);
	text-align: center;
}

.login-form .content p {
	color: var(--primary-blue);
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
	margin-bottom: 0;
	letter-spacing: -0.025em;
}

.login-form .content {
	padding: 0 2rem 1rem 2rem;
}

.login-form .content .input {
	width: 100%;
	box-sizing: border-box;
	padding: 1rem 1.25rem;
	color: var(--gray-700);
	background: white;
	border: 2px solid var(--gray-200);
	border-radius: 12px;
	font-size: 1rem;
	font-family: inherit;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-sm);
}

.login-form .content .input:focus {
	border-color: var(--primary-blue);
	box-shadow: 0 0 0 3px rgba(1, 87, 155, 0.1);
	transform: translateY(-1px);
}

.login-form .content .input:hover {
	border-color: var(--accent-blue);
	box-shadow: var(--shadow-md);
}

.login-form .content .username, 
.login-form .content .password {
	margin-bottom: 1rem;
}

.login-form .content .input::placeholder {
	color: var(--gray-600);
	opacity: 0.7;
}

.login-form .footer {
	padding: 0 2rem 2rem 2rem;
}

.login-form .footer input[type="submit"], #submit {
	width: 100%;
	height: 3.5rem;
	color: white;
	background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
	border: none;
	border-radius: 12px;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-md);
}

.login-form .footer input[type="submit"]:hover, 
#submit:hover {
	background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--accent-blue) 100%);
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

.login-form .footer input[type="submit"]:active,
#submit:active {
	transform: translateY(0);
	box-shadow: var(--shadow-md);
}

#wrapper > form > div.content > label {
	font-size: 0.875rem;
	color: var(--accent-blue);
	font-weight: 500;
	margin-left: 0.25rem;
	margin-bottom: 0.5rem;
	display: block;
	visibility: hidden;
	transition: all 0.3s ease;
}
.login-form .footer .register {
	display: block;
	float: right;
	padding: 10px;
	margin-right: 20px;
	background: none;
	border: none;
	cursor: pointer;
	font-weight: 300;
	font-size: 18px;
	color: #414848;
	text-shadow: 0px 1px 0 rgba(256,256,256,0.5);
}

.login-form .footer .register:hover {
	color: #3f9db8;
}

.login-form .footer .register:focus {
	position: relative;
	bottom: -1px;
}
.login-auth-error {
	width: 100%;
	max-width: 420px;
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
	border: 1px solid rgba(239, 68, 68, 0.5);
	border-radius: 12px;
	color: white;
	margin: 0 auto 1rem auto;
	text-align: center;
	padding: 1rem;
	position: relative;
	box-shadow: var(--shadow-md);
	font-weight: 500;
}
.fadeOutLabel {
	visibility: hidden !important;
	opacity: 0;
	transition: visibility 0s 0.5s, opacity 0.5s linear;
}
.fadeInLabel {
	visibility: visible !important;
	opacity: 1;
	transition: opacity 0.5s linear;
}
.fadeOutInput::placeholder {
	visibility: hidden;
	opacity: 0;
	transition: visibility 0s 0.5s, opacity 0.5s linear;
}
.fadeInInput::placeholder {
	visibility: visible;
	opacity: 1;
	transition: opacity 0.5s linear;
}
.parsley-errors-list > li {
	list-style-type: none;
	color: #f35e64;
	font-size: 0.8rem;
}

/* Estilos para CAPTCHA de texto */
.captcha-group {
    margin-bottom: 0.5rem;
}

.captcha-container {
    width: 100%;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.captcha-container:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

.captcha-image-container {
    margin-bottom: 0.75rem;
}

.captcha-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0 0 0.5rem 0;
    display: block;
}

.captcha-image-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.captcha-image {
    width: 200px;
    height: 60px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--gray-50);
    display: block;
}

.captcha-refresh {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.captcha-refresh:hover {
    background: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.captcha-refresh:active {
    transform: rotate(180deg) scale(0.95);
}

.captcha-input {
    width: 100%;
/*    margin-top: 0.5rem;*/
    background: white;
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}

.captcha-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(1, 87, 155, 0.1);
}

.captcha-help {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
    padding-left: 0.25rem;
    line-height: 1.4;
}

/* Estados de CAPTCHA */
.captcha-loading .captcha-question {
    color: var(--gray-500);
    font-style: italic;
}

.captcha-error .captcha-container {
    border-color: #ef4444;
    background: #fef2f2;
}

.captcha-error .captcha-question {
    border-color: #ef4444;
    background: #fee2e2;
    color: #dc2626;
}

.captcha-success .captcha-container {
    border-color: #10b981;
    background: #f0fdf4;
}

.captcha-success .captcha-question {
    border-color: #10b981;
    background: #dcfce7;
    color: #059669;
}

/* Animaciones para CAPTCHA */
@keyframes captchaRefresh {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.captcha-refresh.refreshing {
    animation: captchaRefresh 0.5s ease-in-out;
    pointer-events: none;
}

/* Responsive para CAPTCHA */
@media (max-width: 480px) {
    .captcha-question-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .captcha-label {
        text-align: center;
    }
    
    .captcha-question {
        min-height: 3rem;
        text-align: center;
    }
    
    .captcha-refresh {
        align-self: center;
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
}

.spinner {
  margin: auto;
  width: 80px;
  text-align: center;
  display: flex;
  justify-content: center;
}

.spinner > div {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  background-color: #0c3354;
  border-radius: 20%;
  display: inline-block;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
  0%, 80%, 100% { -webkit-transform: scale(0) }
  40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
  0%, 80%, 100% { 
    -webkit-transform: scale(0);
    transform: scale(0);
  } 40% { 
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
  }
}

/* Animaciones de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  #wrapper {
    width: 95vw;
    padding: 0 1rem;
  }
  
  .login-form {
    border-radius: 16px;
  }
  
  .login-form .content {
    padding: 0 1.5rem 1.5rem 1.5rem;
  }
  
  .login-form .footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
  }
  
  .login-form .header {
    padding: 1.5rem 0 0.75rem 0;
  }
  
  .login-form .content p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .login-form .content .input {
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }
  
  .login-form .footer input[type="submit"], 
  #submit {
    height: 3rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .logo-header img {
    width: 100px;
  }
  
  .login-form .header img {
    width: 100px;
  }
  
  .login-form .content .input {
    padding: 0.75rem 0.875rem;
  }
  
  body::before {
    background-size: 50px 50px;
  }
}

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