:root {
    --medra-blue: #3A5795;
    --medra-hover: #2d4373;
    --bg-light: #f4f6f8;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-soft: #dcdfe6;
    --success-green: #10b981;
    --error-red: #ef4444;
}

body {
    margin: 0;
    font-family: 'Poppins', Arial, sans-serif;
    text-align: center;
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
    background-color: var(--medra-blue);
    padding: 0 20px;
    height: 60px; 
    display: flex;
    justify-content: center; 
    align-items: center;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    background: rgba(255, 255, 255, 0.15);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 16px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    text-transform: lowercase;
}

.brand-tag {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ==========================================================================
   MAIN CONTENT & LOGIN
   ========================================================================== */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-panel {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.login-panel h2 {
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: 500;
    color: var(--text-main);
}

/* FORMS */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #ffffff;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--medra-blue);
    box-shadow: 0 0 0 3px rgba(58, 87, 149, 0.1);
    outline: none;
}

.btn-conectar {
    width: 100%;
    padding: 14px;
    background-color: var(--medra-blue) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    display: block;
}

.btn-conectar:hover {
    background-color: var(--medra-hover) !important;
}

.change-link {
    margin-top: 25px;
}

.change-link a {
    color: var(--medra-blue);
    text-decoration: none;
    font-size: 13px;
    transition: opacity 0.2s;
}

.change-link a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* ==========================================================================
   MODAL DE PROGRESO
   ========================================================================== */
#progressModal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(31, 41, 55, 0.85); 
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #ffffff;
    padding: 0;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--medra-blue);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-body {
    padding: 25px;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.progress-item i { font-size: 18px; }
.progress-item.success i { color: var(--success-green); }
.progress-item.error i { color: var(--error-red); }
.progress-item.loading i { color: var(--medra-blue); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background-color: #ffffff;
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-soft);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-separator {
    color: #d1d5db;
}

.policy-link {
    color: var(--medra-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.policy-link:hover {
    color: var(--medra-hover);
    text-decoration: underline;
}

/* Etiqueta de Versión */
.version-tag {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid var(--border-soft);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 480px) {
    .footer-content {
        flex-direction: column;
        gap: 8px;
    }
    .footer-separator {
        display: none;
    }
    .modal-content {
        width: 85%;
        padding: 0;
    }
}