/* Estilos globales y reseteo */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: #005082; 
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; 
    line-height: 1.5;
}

/* Contenedores Principales */
.login-container {
    width: 33vw; 
    min-width: 350px; 
    max-width: 550px; 
    margin-right: 4vw;
}

.login-card {
    height: 90vh;
    background: #ffffff; 
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    padding: clamp(10px, 6vh, 60px) clamp(20px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card:hover {
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.12),
        0 12px 28px rgba(0, 0, 0, 0.15);
}

/* Cabecera y Logo */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.material-logo {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.logo-layers {
    position: relative;
    width: 56px;
    height: 56px;
}

.layer {
    position: absolute;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.layer-1 {
    width: 56px;
    height: 56px;
    background: #1976d2;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
}

.layer-2 {
    width: 40px;
    height: 40px;
    top: 8px;
    left: 8px;
    background: #2196f3;
    box-shadow: 0 1px 3px rgba(33, 150, 243, 0.3);
}

.layer-3 {
    width: 24px;
    height: 24px;
    top: 16px;
    left: 16px;
    background: #64b5f6;
    box-shadow: 0 1px 2px rgba(100, 181, 246, 0.3);
}

.material-logo:hover .layer-1 { transform: scale(1.1); box-shadow: 0 4px 8px rgba(25, 118, 210, 0.4); }
.material-logo:hover .layer-2 { transform: scale(1.15); box-shadow: 0 2px 6px rgba(33, 150, 243, 0.4); }
.material-logo:hover .layer-3 { transform: scale(1.2); box-shadow: 0 2px 4px rgba(100, 181, 246, 0.4); }

.login-header h2 {
    color: #212121;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: 0.15px;
}

.login-header p {
    color: #757575;
    font-size: 14px;
    font-weight: 400;
}

/* Inputs de Texto Animados */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 0;
    padding: 16px 0 8px;
    color: #212121;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    width: 100%;
    outline: none;
    position: relative;
    z-index: 3;
}

.input-wrapper input:focus { border-bottom-color: #ff5722; }

.input-wrapper input:focus + label,
.input-wrapper input:valid + label {
    transform: translateY(-24px) scale(0.75);
    color: #ff5722;
    font-weight: 500;
}

.input-wrapper label {
    position: absolute;
    left: 0;
    top: 16px;
    color: #757575;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    pointer-events: none;
    transform-origin: left top;
    z-index: 4;
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff5722;
    transition: width 0.2s ease;
    z-index: 5;
}

.input-wrapper input:focus ~ .input-line { width: 100%; }

/* Efecto Ripple */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

/* Mostrar / Ocultar Contraseña */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 56px; }

.password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #757575;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.toggle-icon {
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23757575' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* Olvidé contraseña */
.form-options {
    display: flex;
    justify-content: center; 
    align-items: center;
    margin-bottom: 32px;
}

.forgot-password {
    color: #ff5722;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

.forgot-password:hover { color: #e64a19; }

/* Botón Principal */
.material-btn {
    width: 100%;
    background: #ff5722;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    min-height: 48px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.material-btn:hover {
    background: #e64a19;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.material-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-text {
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.loader-circle { width: 20px; height: 20px; animation: rotate 2s linear infinite; }
.loader-path { stroke-dasharray: 90, 150; stroke-dashoffset: 0; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; }

@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.material-btn.loading .btn-text { opacity: 0; }
.material-btn.loading .btn-loader { opacity: 1; }

/* Estados de Error */
.error-message {
    color: #d32f2f;
    font-size: 12px;
    font-weight: 400;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.error-message.show { opacity: 1; transform: translateY(0); }
.form-group.error .input-wrapper input { border-bottom-color: #d32f2f; color: #d32f2f; }
.form-group.error .input-wrapper label { color: #d32f2f; }
.form-group.error .input-line { background: #d32f2f; }

/* Mensaje de Éxito */
.success-message {
    display: none;
    text-align: center;
    padding: 32px 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.success-message.show { display: block; opacity: 1; transform: translateY(0); }

.success-elevation {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.success-icon {
    width: 48px;
    height: 48px;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.success-icon svg { width: 24px; height: 24px; fill: white; }

.success-message h3 {
    color: #212121;
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.success-message p { color: #757575; font-size: 14px; }

